View topic - More Help with TCP/IP

More Help with TCP/IP

anything that doesn't fit to other groups.

More Help with TCP/IP

Postby maschoen » Fri Jul 23, 2010 11:33 pm

Two TCP/IP questions

1) I'm running a test with one server and multiple clients. At between 90 and 100 clients something happens and my code locks up. I know it's not threads, fd's, or socket's. Any obvious limit I'm hitting?

2) I'm having trouble bringing down a listening socket gracefully. If I just break the program, or if I do a shutdown()/close() on the socket, the socket continues to appear for about a minute with "netstat -a". While it's still there if I re-start the server program it crashes, though that's probably my codes problem. Anyone know the right way to bring the socket down and have it disappear immediately?

This is QNX 6.3.2 if that matters.

Thank you,
maschoen
QNX Master
 
Posts: 2657
Joined: Wed Jun 25, 2003 5:18 pm

RE: More Help with TCP/IP

Postby mario » Sat Jul 24, 2010 1:38 pm

1) can`t say with more info.

2) what state are they in? For sockets to gracefully terminate BOTH ends must do a close it. Maybe that is what is happening in your case. As for the crash at startup, it`s possible that you can`t bind or create a socket on a specify port, and not handling that case properly. Check out the REUSE ADRESS and REUSE PORT flag of setsocketopt() (flag name by memory).
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Re: RE: More Help with TCP/IP

Postby maschoen » Tue Jul 27, 2010 2:10 am

mario wrote:1) can`t say with more info.

The problem turned out to be that io-net or io-pkt were running out of threads. The default limit is 200. Upping that limit made the problem go away.

2) what state are they in? For sockets to gracefully terminate BOTH ends must do a close it. Maybe that is what is happening in your case. As for the crash at startup, it`s possible that you can`t bind or create a socket on a specify port, and not handling that case properly. Check out the REUSE ADRESS and REUSE PORT flag of setsocketopt() (flag name by memory).


Right and Right Mario. It was a bad print statement that occurred when bind() failed. Setting the REUSE with setsockopt() allowed immediate re-access.

Thanks,

Mitchell
maschoen
QNX Master
 
Posts: 2657
Joined: Wed Jun 25, 2003 5:18 pm


Return to General Programming

Who is online

Users browsing this forum: No registered users and 5 guests