Page 1 of 1

server connection

Posted: 19 May 2017, 11:01
by Paradox
I trying to connect to remote server and it gives me an error.

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)

Re: server connection

Posted: 19 May 2017, 14:06
by Lapo
Hi,
please explain what runtime you're using? Is it standard .Net? Windows Store? Mono?

Also what API version are you using and which DLL are you using (we provide several, for different targets).

Thanks
p.s. = have you reconfigured the server to run on TCP port 443? By default SFS2X runs on 9933.

Re: server connection

Posted: 19 May 2017, 17:30
by Paradox
Lapo wrote:Hi,
please explain what runtime you're using? Is it standard .Net? Windows Store? Mono?

Also what API version are you using and which DLL are you using (we provide several, for different targets).

Thanks
p.s. = have you reconfigured the server to run on TCP port 443? By default SFS2X runs on 9933.

It's standard .net.
I use "SmartFox2X" DLL ,version 1.7.2.
Yes, the TCP port server that I want to connect is 443.

Re: server connection

Posted: 19 May 2017, 18:32
by Lapo
Paradox wrote:
Lapo wrote:Hi,
please explain what runtime you're using? Is it standard .Net? Windows Store? Mono?

Also what API version are you using and which DLL are you using (we provide several, for different targets).

Thanks
p.s. = have you reconfigured the server to run on TCP port 443? By default SFS2X runs on 9933.

It's standard .net.
I use "SmartFox2X" DLL ,version 1.7.2.

Okay, however we distribute that .dll for 4 different platforms. I just wanted to make sure you're using the one from the "DotNet" folder in our distribution.
Can you confirm this?

Thanks

Re: server connection

Posted: 20 May 2017, 07:02
by Paradox
Lapo wrote:
Paradox wrote:
Lapo wrote:Hi,
please explain what runtime you're using? Is it standard .Net? Windows Store? Mono?

Also what API version are you using and which DLL are you using (we provide several, for different targets).

Thanks
p.s. = have you reconfigured the server to run on TCP port 443? By default SFS2X runs on 9933.

It's standard .net.
I use "SmartFox2X" DLL ,version 1.7.2.

Okay, however we distribute that .dll for 4 different platforms. I just wanted to make sure you're using the one from the "DotNet" folder in our distribution.
Can you confirm this?

Thanks

Yes, I using dll from DotNet folder.

Re: server connection

Posted: 20 May 2017, 17:04
by Lapo
I tested your code in Mono Develop (on Mac) using the latest DLL and connecting to my local SFS2X and it works just fine.

I would recommend trying the same, i.e. testing with a local server. If this works it's likely you're unable to reach the remote server. If that's the case you should investigate what might be going on (firewall? etc...)

Let us know