Is there a way to get notified if a specific send() complete? As I noticed, the send() function does not block, but the code is continuous. Is there an easy way to block or receive a notification that the transfer is complete?
send()
You can rely on Socket.bufferedamount (never tried)
http://www.whatwg.org/specs/web-apps/current-work/multipage/network.html#dom-websocket-bufferedamount
var socket = new WebSocket('ws://game.example.com:12010/updates'); socket.onopen = function () { setInterval(function() { if (socket.bufferedAmount == 0){ // Im' not busy anymore - set a flag or something like that } }, 50); };
Or, execute a confirmation response from the server for each client message (after trying, it works fine)
Source: https://habr.com/ru/post/951560/More articles:How to get each log in a separate log file? - logbackhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/951556/twitter-bootstrap-how-to-get-buttons-to-be-block-level-only-on-extra-small-and-small-devices&usg=ALkJrhj4_WwZBmqfoaBo1aNv0UH_1B4_ogAdd Column to Existing SQL Server Table - Consequences - c #How to select files from Google Drive in Android? - androidUsing Flash Sessions in Gevent Socket-IO - flask"ERROR 2013 (HY000): lost connection to MySQL server during query" when deleting a database - sqlMake the cell not clickable, but the button on it should still be pressed - iosCan I search / index my own data source in Orchard via Lucene? - c #How do internal / dependent properties work and where are the values โโstored? - wpfImplicit conversions in C ++ - c ++All Articles