Can not connect to remote server

Apr 11, 2012 at 10:05 PM

 I have a simple chat server which I am able to connect to when the server is running on local host, but when I uploaded the server application to my webserver machine and ran it from there I am not able to connect.  

   It is being run in console mode and some code snippets are below

.
.
.

websocketServer = new WebSocketServer();
websocketServer.Setup(new RootConfig(), new ServerConfig
{
   Port = 2012,
   Ip = "xx.xx.xx.xx",  //Correct IP address
  MaxConnectionNumber = 100,
  Mode = SocketMode.Async,
  Name = "SuperWebSocket Server"
}, SocketServerFactory.Instance);

.
.
.

if (!websocketServer.Start())
                Console.WriteLine("Someerror");

Console.WriteLine("The server is started, press 'Q' to quit the server!");

.
.
.

 

Starting the application displays "The server is started, press 'Q' to quite the server!

The app.config is same as from test sln

Running netstat -an on webserver shows 

TCP     <MachineIP>:2012      0.0.0.0:0    LISTENING

 

I have a test webpage with javascript such as:

socket = new WebSocket('ws://<MachineIP>:2012');

 

I have set a firewall rule appling to Domain,Private, and Public; protocol type "Any" Local port: All Ports  

Upon starting the Server, I got a pop-up "windows ...Blah blah..." Allow this program to communicate over these networks... I allowed communication.


So long story short ... I am able to connect and everything works well when i run the server on my development machine, but I get nadda when attempting to connect to server on web server...

Coordinator
Apr 12, 2012 at 1:27 AM
Did you check the log files to see if the server was started successfully?
The logs locate in /Logs.
And did you test the connecting the server from the the server itself?
From: [email removed]
Sent: Thursday, April 12, 2012 6:05 AM
To: [email removed]
Subject: Can not connect to remote server [SuperWebSocket:351970]

From: Paragon99

I have a simple chat server which I am able to connect to when the server is running on local host, but when I uploaded the server application to my webserver machine and ran it from there I am not able to connect.

It is being run in console mode and some code snippets are below

.
.
.

websocketServer = new WebSocketServer();
websocketServer.Setup(new RootConfig(), new ServerConfig
{
   Port = 2012,
   Ip = "xx.xx.xx.xx",  //Correct IP address
  MaxConnectionNumber = 100,
  Mode = SocketMode.Async,
  Name = "SuperWebSocket Server"
}, SocketServerFactory.Instance);

.
.
.

if (!websocketServer.Start())
                Console.WriteLine("Someerror");

Console.WriteLine("The server is started, press 'Q' to quit the server!");

.
.
.

Starting the application displays "The server is started, press 'Q' to quite the server!

The app.config is same as from test sln

Running netstat -an on webserver shows

TCP <MachineIP>:2012 0.0.0.0:0 LISTENING

I have a test webpage with javascript such as:

socket = new WebSocket('ws://<MachineIP>:2012');

I have set a firewall rule appling to Domain,Private, and Public; protocol type "Any" Local port: All Ports

Upon starting the Server, I got a pop-up "windows ...Blah blah..." Allow this program to communicate over these networks... I allowed communication.


So long story short ... I am able to connect and everything works well when i run the server on my development machine, but I get nadda when attempting to connect to server on web server...

Apr 12, 2012 at 3:11 PM

The logs showed that everything looked to be ok.

I am able to connect to the server application by 1) Directly opening the test html file, 2) Navigating to page hosted by the local webserver.

However, Navigating to the page hosted by that web server from another machine, does not work. 

Apr 12, 2012 at 10:04 PM

I had temporarily turned of the firewall on the server machine, it is a virtual server hosted by a web hosting service... I contacted them and they were rather adament that the port 2012 was not being blocked. I have the application running on that machine, and I have a website Test.html hosted on that machine. 

While using a remote desktop conection, I am able to directly open the test.html file, and I am able to navigate to that site by ip and everything works fine. 

From my home computer I can navigate to test.html, but test.html is unable to establish a connection to the websocketserver application. 

Coordinator
Apr 13, 2012 at 1:29 AM

Did you check the logs of SuperWebSocket? Please answer my question, it is important.

Apr 13, 2012 at 1:50 PM

The only logs that I was able to find was System.net.trace.log:

It looks as though it starts without issue.

Network 2 is a public network connected to the internet. 

I am not sure why it is being called InterNetwork#2.

---Just after start up ------

System.Net.Sockets Verbose: 0 : [131212] Socket#63835064::Socket(InterNetwork#2)

System.Net.Sockets Verbose: 0 : [131212] Exiting Socket#63835064::Socket() 

System.Net.Sockets Verbose: 0 : [131212] Socket#63835064::Bind(47:2012#792082670)

System.Net.Sockets Verbose: 0 : [131212] Exiting Socket#63835064::Bind()

 System.Net.Sockets Verbose: 0 : [131212] Socket#63835064::Listen(100#100)

System.Net.Sockets Verbose: 0 : [131212] Exiting Socket#63835064::Listen() 

System.Net.Sockets Verbose: 0 : [131212] Socket#63835064::AcceptAsync()

System.Net.Sockets Verbose: 0 : [131212] Socket#21950498::Socket(InterNetwork#2)

System.Net.Sockets Verbose: 0 : [131212] Exiting Socket#21950498::Socket() 

System.Net.Sockets Verbose: 0 : [131212] Exiting Socket#63835064::AcceptAsync() -> True#1

 

---- After shutdown ----

System.Net.Sockets Verbose: 0 : [85780] Socket#63835064::Close()

System.Net.Sockets Verbose: 0 : [85780] Socket#63835064::Dispose()

System.Net.Sockets Verbose: 0 : [85780] Exiting Socket#63835064::Close() 

Coordinator
Apr 13, 2012 at 1:53 PM

Oh, it is not log of SuperSocket/SuperWebSocket!

http://supersocket.codeplex.com/wikipage?title=Logger%20in%20SuperSocket

Apr 13, 2012 at 2:41 PM

Ok, Thank you for the link. I set up log4net. To test that I correctly configured logging I used an invalid IP Address, as expected the error log stated that the address was not valid in the current context, After correcting the IP Address The server started no entries were logged to any of the logs except The sub protocol commands found which was logged to the debug log.