Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sockets just going away Windows Server 1

Status
Not open for further replies.

cdlvj

MIS
Nov 18, 2003
678
US
Looking for any ideas as to fixing a program problem.

I have a server (as a service) which listens for socket connections 24x7. It is message logging system, connection opens and a child is forked to handle traffic, and main program goes back to listen. The child simply puts the messages into a MSSQL Table.

I have three service programs which open the connect and work all day sending messages. Then I have many short programs which kick off during the day and connect, send messages, and disconnect.

The problem I have is after a while the server stops responding to new connections. The (threads) (child) still continue to respond to the services.

This is all random, no set pattern.

Now if I bring down the service programs, the Server aborts.

Anyone have these issues? Any suggestions on how to trap the problem?
Thanks in advance.
 
Adaptive Firewall?

What version of OS?

What sort of logging have you in place, error trapping?

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
All this is running on same server.
Windows Standard server 2003.

No firewall.

The programs instatiate a class and there is just a method to send messages. Have startup, general messages as a process goes on its way, and ending message.

If get a trap, then send message in ReportErr.
$SIG{__DIE__} = \&ReportErr;

This all works fine except randomly the server stops accepting connections. The children continue working on those 3 service perl programs.
 
Try looking at netstat output and see if you can deduce something from that. Can you reopen the ports every 10 cycles or so, and increase until you get a 'safe' amount.

You're not reopening already open ports? What status do you expect the ports to be in when you view the netstat output?

--Paul

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
PaulTEG,

You are absolutely right, I may be leaving a connection open. I have got the utilities from sysinternals, and check that out the next time it happens.
 
Just looked at the client code which is a perl class. I have a destructor, and I need to close the socket. Which more than likely is the problem.

Thanks.
 
Closing the socket really does nothing as the system would have closed it anyway.

The server creation of the socket has a parm to indicate the number of sockets. I totally forgot about the low setting of 5 when I was testing. Bolt of Lightning!! duh
Set the number higher.

 
good stuff, glad you're sorted

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top