-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About websockets #20
Comments
@terhoraj you can check this project for the java websocket library: https://github.com/koush/AndroidAsync Obj-C websocket library: C# websocket client library: |
I have now tried AndroidAsync library websocket part with tons of differently formed url:s the the server and last result was handshake error. No luck. Web GUI works as far as login so I believe that side is fine. |
Does anyone reading this have solved this websocket side for example mobile side since when I look at the code I don't even see implementation for websocket's. |
I find a better C# library for socket.io: |
Using nuget to add the .NET library to your C# project nuget SocketIoClientDotNet Then write C# code to connect and send request to casino server. using System;
using Quobject.SocketIoClientDotNet.Client;
namespace iotest
{
class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
var socket = IO.Socket("http://127.0.0.1:7000");
socket.On(Socket.EVENT_CONNECT, () =>
{
Console.WriteLine("Connected.");
socket.Emit("hello");
});
socket.On("notify", (data) =>
{
Console.WriteLine(data);
});
socket.On("rpc_ret", (data) =>
{
Console.WriteLine(data);
});
while (true)
{
string str = Console.ReadLine();
if (str == "quit") break;
else socket.Emit("rpc", str);
}
socket.Disconnect();
}
}
} Run test, console output: iMac:Debug liming$ mono test.exe
Hello World!
Connected.
{
"uid": null,
"e": "prompt",
"args": {
"fastsignup": true,
"signup": {
"uid": "text",
"passwd": "text",
"name": "text",
"email": "email",
"phone": "text",
"uuid": "text"
},
"login": {
"uid": "text",
"passwd": "text"
}
}
}
login
{
"err": 400,
"ret": "invalid rpc req"
} |
Update: |
Can you lighten me up with few words how do I actually can use websockets from mobile side for example android.
I only need to know about for instance, whats the actual "api" address for websocket protocol and is it ws:// schema starting. I'm new to websocket and I don't want to know all by asking, I'm going to do my own research.
Web client example seems pretty clear to me but it's socket.io at your image. Socket.io is similar to websockets or completely different method?
Thanks for awesome server platform!
The text was updated successfully, but these errors were encountered: