xsockets.net - Inferior behavior of XSockets under Mono compared to MS.NET -
xsockets.net - Inferior behavior of XSockets under Mono compared to MS.NET -
given
i using xsockets 3.0.6 think latest stable version. under ms.net behavior expected. on ubuntu 14.04 , mono 3.6.1 though server has kind of delays before sending messages clients.
problemon ms.net when type string in client , send it, clients immediately notified. on mono though message received server , clients not notified immediately. 1 message waited 5 minutes , clients still not notified. when messages become 5-6 clients become notified messages @ once. seems server uses kind of buffering conditionally - depending on .net runtime, strange.
questionam doing wrong? how alter code clients notified in ms.net?
codei followed (and modified) quick start illustration follows...
server initializationusing (var container = composable.getexport<ixsocketservercontainer>()) { container.startservers(); foreach (var server in container.servers) { console.writeline(server.configurationsetting.endpoint); } console.write("started! nail 'enter' quit."); console.readline(); container.stopservers(); }
custom controller public class customcontroller : xsocketcontroller { public override void onmessage(itextargs textargs) { console.writeline ("no delay = {0}", this.socket.socket.nodelay); if (!this.socket.socket.nodelay) { socket.socket.nodelay = true; } console.writeline("received {0} {1}.", textargs.data, textargs.@event); this.sendtoall(textargs); } }
client var client = new xsocketclient("ws://127.0.0.1:4502/customcontroller", "*"); client.onopen += (sender, eventargs) => system.console.writeline("open"); client.bind("foo", message => system.console.writeline(message.data)); thread.sleep(1000); client.open(); string input; system.console.writeline("type 'quit' quit , other string send message:"); { input = system.console.readline(); if (input != "quit") { client.send(input, "foo"); } } while (input != "quit");
i experienced self when running xsockets on raspberry pi. after investigation realized had fact pi single core , internal queue did not send message out until 5 messages sent in.... messages sent out.
how many cores computer have ?
this issue resolved in 4.0 (in alpha right now)
edit: have had issue on single core machines mono, on mac book air works great on mono
mono xsockets.net
Comments
Post a Comment