java - How to establish a socket connection between a Play 2 server and a C# application? -
I have to establish a connection between the server that is written in the Client desktop application in Play Framework 2 and C # of Java. The nature of the system is such that many messages must be pushed from the server to the customer, so using sockets should be a natural approach, especially when they are supported by play (i.e., websicet).
However, there is a lack of support for WebSocket by C # I managed to use the There is also the Alchemy websites library, but I can not get it to work. I start my server, check that it is working with the page and then starting the console client, but this is absolutely nothing, there is no response, whatever the server tries to connect Does not pay attention to him Here I have used the C # code for: So, my question is whether there are any implementations of webcast clients or maybe the library built on top of Or maybe there is a way to use Simple Sockets (not WebSocket) with Play Framework 2? I would be happy to get some help. It has been found that in some way the first library does not work properly and the use of it It's easy to do, so to answer that question my library has the answer. System.Net.WebSockets.ClientWebSocket class to connect to my server, but it The square is at very low level, type buffers
ArraySegment & lt; Byte & gt; There is nowhere near the JS-implementation of WebSocket, where I can only get the string of variable length. This class is considered as the last resort for me, if I do not get a better solution.
private static zero main () {var aclient = new alchemy WebSocketClient ("ws: // localhost: 9000 / wstest") {OnReceive = Reference = & gt; Console.light line ("received"), onconnect = context = & gt; Console "Line" ("connect"), onend = reference = & gt; Console "Written" ("Send"), OnDisNought = Reference = & gt; Console.light line ("discontent"); AClient.Connect (); AClient.Send ("Hi!"); Console.ReadLine (); }
ClientWebSocket which I have not yet received ?
Comments
Post a Comment