Code:
Code: Select all
static void Main(string[] args)
{
SmartFox sfs = new SmartFox();
sfs.Connect("xxx.x.xxx.xxx", 443);
sfs.AddEventListener(SFSEvent.CONNECTION, OnConnection);
Console.Read();
}
static void OnConnection(BaseEvent e)
{
if ((bool)e.Params["success"])
{
Console.WriteLine("success");
}
else
{
Console.WriteLine("error");
}
}
Error:
[SFS - ERROR] [TCPSocketLayer] Connection closed by the remote side
[SFS - ERROR] ## BlueBox Error: Error during http request: System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at Sfs2X.Http.SFSWebClient.UploadValuesAsync(Uri uri, String paramName, String encodedData) at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at Sfs2X.Http.SFSWebClient.UploadValuesAsync(Uri uri, String paramName, String encodedData)