Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Server Socket and Windows XP

 
sopal Pal
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I created a ServerSocket in my Program on an unused port.
The ServerSocket creation goes on fine. This is running on an XP Box.

** I have turned on Firewall protection in XP.
After sometime I get this system error message from the System which says

Windows Security Alert

Do want to keep blocking this program
Name : java
Publisher : Unknown

This never happened on a Windows 200o box and as soon as I remove the ServerSocket Code it works fine.

Any idea why this is happening.
Thanks for the time and help

Sumit
 
Rovas Kram
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have turned on Firewall protection in XP.


I'm assuming that you didn't have the Firewall protection in Win 2000 when I guess that you need to configure your firewall to accept that socket.
 
sopal Pal
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rovas
I am trying to prepare for the scenario in Win XP SP2, where Firewall is turned on by default.

IN that case my application would not work at all.
In Win 2000 and WinXP SP1 the firewall is off by default and it works.

When I create an instance of ServerSocket am I listeneing to it.
I think that unless I make the call to do - accept I am not listeneing.
So why does the System croak back when I am not actually listening.

Sumit
 
Rovas Kram
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following code is what I expect you have coded.



When you run this code, the server is listening on your port. Am I right?
[ August 09, 2004: Message edited by: Rovas Kram ]
 
sopal Pal
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Even before I do the blocking accept call - I get this message from the system.
That is the most confusing part.
Why is it even preventing that.
Sumit
 
Rovas Kram
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sopal,

I read in the java api for ServerSocket that the constructor binds the socket to the port. Maybe that means that after the ServerSocket is constructed but before accept is called the OS has already been informed that the port is in use - thus the message your receiving.
 
sopal Pal
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
So does this mean that in order to run an application that uses ServerSocket code - the firewall protection has to be turned off.
Does this sound logical. In that case - any web server / rmi server running on the Windows XP box has to turn off the firewall before the server can even start.
Your time and advise is highly appreciated.
Sumit
 
Rovas Kram
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know a lot about firewalls but my understanding is that you have to specifically open ports up. For example, if you want to let anyone use your ftp server, you have to configure your firewall to accept connections to port 25 from everyone. In your case, you'd have to use a specific port for your socket and then enable connections to that port.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic