Closed dannyyy closed 9 years ago
When you get the event "OnConnected" on client level this only means that you have a socket open and that the handshake is completed. You have not yet opened a controller. When you get "OnOpen" on a controller you will have both ConnectionId and PersistentId.
See this sample
var client = new XSocketClient("ws://localhost:4502", "http://localhost", new [] {"Test"});
client.OnConnected += (sender, args) =>
{
//Socket is open and handshake is completed... but you will not have a ConnectionId or PersistentId.
//You will have that once the controller is used... in this case when test is opened
Console.WriteLine("PersistentId {0}", client.PersistentId);
};
client.Controller("test").OnOpen += (sender, args) =>
{
//Now you will have connectionId and PersistenId
Console.WriteLine("PersistentId {0}", args.ClientInfo.PersistentId);
Console.WriteLine("ConnectionId {0}", args.ClientInfo.ConnectionId);
};
client.Open();
Thank you very much! Issue can be closed.
After establishing a connection to the server successfully the client hasn't a ConnectionId nor PersistentId set. Both properties returns Guid.Empty.
A sample project can be found here: http://www.heiniger.ch/cloud/XSocketsConnectionSample.zip