Login  
Search All Forums
Dart Home | PowerTCP WebServer for ActiveX | Custom Development Reply | PowerTCP WebServer for ActiveX Topics | Forums   
AuthorForum: PowerTCP WebServer for ActiveX
Topic: Webserver tool reports port in use no matter what port is used
chris@digitalinsights.com

From: San Clemente, CA USA
Posts: 73
Member Since: 11/03/03
posted July 15, 2004 11:58 AM

I have a client that cannot start the webserver control, with the error being reported:

===============================================
Connect, Listen or Open method failed. Only one usage of each socket address (protocol/IP address/port) is normally permitted. This error occurs if an application attempts to bind() a socket to an IP address/port that has already been used for an existing socket, or a socket that wasn't closed properly, or one that is still in the process of closing. For server applications that need to bind() multiple sockets to the same port number, consider using setsockopt(SO_REUSEADDR).
=================================================

netstat -n does not show the port (81) in use, and if we change the port to a variety of other ports we get the same error. The program with the control works on a ton of other machines so there is no coding problem. Do you know what it could be?
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted July 16, 2004 11:24 AM

Hi,
Are you sure it is the non-secure port that is causing the error?
What happens if you change the LocalSecurePort parameter?
Thanks,
-ken
chris@digitalinsights.com

From: San Clemente, CA USA
Posts: 73
Member Since: 11/03/03
posted July 16, 2004 12:12 PM

Here is some further information:

There are two webserver controls on a form, and they are started with these lines:

WebServer1.Start 81, -1, "", ""
WebServer2.Start 82, -1, "", ""

It fails on the first one. Could it be a bad webserver dll?

Hopefully this can shed some light.

Thanks
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted July 19, 2004 11:00 AM

Hi,
Is port 81 listed when you use netstat:
netstat -an
?

Thanks,
-ken
chris@digitalinsights.com

From: San Clemente, CA USA
Posts: 73
Member Since: 11/03/03
posted July 19, 2004 11:20 AM

No, it is not listed. That was the first thing I check in the beginning.
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted July 19, 2004 11:28 AM

Hi,
Ok, you mentioned "netstat -n" (where it would not be listed), so I just wanted to make sure you tried "netstat -an".

I'm not sure what to tell you. This is a socket exception that winsock is raising and we are reporting. 

Is it possible there are multiple local IPs on the machine? 
What happens if you specify the LocalAddress param of the Start call?

Thanks,
-ken

chris@digitalinsights.com

From: San Clemente, CA USA
Posts: 73
Member Since: 11/03/03
posted July 19, 2004 11:29 AM

Good idea. I will try forcing the address to a specific IP.
chris@digitalinsights.com

From: San Clemente, CA USA
Posts: 73
Member Since: 11/03/03
posted July 20, 2004 11:10 AM

Good news! Binding it webserver control (non-secure) to the specific IP on the machine allowed the webserver to start. This is not the solution that will work but it might give you some insight on what is going on. If I leave the non-secure address blank, it does not start, but if you using the IP on the machine, it works. There is only one IP one the machine. What can I look for so I can start the webserver without specifying the IP?

Thanks

K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted July 21, 2004 12:09 PM

Hi,
What is the IP address listed under Network Connections from the Control Panel?
If no address is specified, the control uses the system's default IP address.
-ken
chris@digitalinsights.com

From: San Clemente, CA USA
Posts: 73
Member Since: 11/03/03
posted July 21, 2004 12:39 PM

It turns out that there are 4 IPs binded to the same NIC Card. Sorry about that. Does this give you insight on anything new?
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted July 21, 2004 5:54 PM

Hi,
No, other than the netstat must have been for an IP other than the system default.
It is probably a good idea to give the user the option of specifying the local IP, to prevent a conflict like this.
-ken
Reply | PowerTCP WebServer for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX