- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Socket & IP (timeout)
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2003 01:52 AM
тАО04-11-2003 01:52 AM
we've an application client-server based on socket communication via IP; the server accpet connection on port 5001 then creates a new socket where the communication with the client is managed.
If we disconnect the LAN for a meaningful time then when the connection is re-established the communication client-server is done by a new couple of sockets ... the "old" socket on the server is no more used and it is no explicitly closed so the number of unused sockets an increase.
My question is: I suppose there's a "timeout" for the socket relating to the IP connection .... when a timeout is expired the socket should receive an event to say that it is no more valid; is my hypothesis true? if so, why we don't receive any events? does it depend on the kind of the "bind"? or something else?
thanks a lot
Enrico
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2003 02:20 AM
тАО04-11-2003 02:20 AM
Re: Socket & IP (timeout)
use netstat -an or netstat -a | grep 5001 during lan removal.
Watch out for FIN_WAIT2's too.
Later,
Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2003 02:23 AM
тАО04-11-2003 02:23 AM
Re: Socket & IP (timeout)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2003 02:24 AM
тАО04-11-2003 02:24 AM
Re: Socket & IP (timeout)
Does the socket receive some trigger when the IP timeout expires?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2003 02:24 AM
тАО04-11-2003 02:24 AM
Re: Socket & IP (timeout)
Does the socket receive some trigger when the IP timeout expires?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2003 02:35 AM
тАО04-11-2003 02:35 AM
Re: Socket & IP (timeout)
The sockets will receive a timeout and also a fin_wait(s) whilst the connection is waiting for a time out connection from the client.
The fin_wait sockets will only close if the timeout is set check nettune on 10.20 or ndd on 11. as previously stated.
I've attached a handy connection state gif that illustrates the point better than my explanation.....
Hope this helps....
-ChaZ-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2003 02:41 AM
тАО04-11-2003 02:41 AM
Re: Socket & IP (timeout)
in which way does the socket receive a timeout trigger?? by which call??
and moreover, which is the parameter to see in ndd? and who can I get all the socket in FIN_WAIT by an API?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2003 02:56 AM
тАО04-11-2003 02:56 AM
Re: Socket & IP (timeout)
What status are the sockets you are seeing as unused ? - When you disconnect the LAN you will see only the listening sockets after all of the other connections have been closed. If I understand, I think you are asking why more sockets are used other than a single connection on 5900? - If this is the case, the reason other sockets are used is to allow for more than one concurrent connection to the listener socket.
As more connections are made to the Listener port, the server spawns more sockets as part of the tcp connection, to allow further connections to the orginal socket.
Hope this helps!
-ChaZ-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2003 03:01 AM
тАО04-11-2003 03:01 AM
Re: Socket & IP (timeout)
I think the ndd parameters you are looking for are:
tcp_keepalive_detached_interval - Send keepalive probes for detached TCP
tcp_keepalive_interval - Interval for sending keepalive probes
From the socket(2) manpage recv() will error with ETIMEOUT after the tcp_keepalive_interval (default 2hrs). I'd imagine a close() or shutdown() is then sent to that stream.
Regards,
James.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2003 03:04 AM
тАО04-11-2003 03:04 AM
Re: Socket & IP (timeout)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2003 04:01 AM
тАО04-11-2003 04:01 AM
Re: Socket & IP (timeout)
I perform a select(fd) where fd is the list of the file descriptors created in the process scope: the select gives me the sublist of the fd's where the recv() should find something ...
As far as concerning the socket bound to the (lost) IP connection, the select doesn't find anything on them. .....
Are there any parameters affecting the socket behaviour relating to the IP connection availability?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2003 06:51 AM
тАО04-11-2003 06:51 AM
Re: Socket & IP (timeout)
tcp_time_wait_interval:
Amount of time TCP endpoints persist in TCPS_TIME_WAIT state.
[1000,600000] Default: 60000 (60 seconds)
This means that after 60 seconds the TIME WAIT state should go away. Presumably the TCP/IP stack should then signal back to the process that started the connection that the connection no longer exists. I'm not a programmer so I am not familiar with the way this happens.
This is probably a bit conservative so you could reduce this if you are just working with a few machines that you control.
ndd -set /dev/tcp tcp_time_wait_interval 30000
would reduce it to 30 secs. You have to edit /etc/rc.config.d/nddconf to make it stay after a reboot.
TRANSPORT_NAME[0]=tcp
NDD_NAME[0]=tcp_time_wait_interval
NDD_VALUE[0]=30000
(Use the next higher integer in the brackets if you already have entries in nddconf)
I'm not sure which language you are using but you might benefit from reading how Perl does it:
http://www.perlfect.com/articles/sockets.shtml
Be sure to read the links at the bottom.
For more advanced info (note the references):
http://216.239.57.100/search?q=cache:4V3XWMAx008C:www.csd.uch.gr/~markatos/papers/issues.ps+hpux+%22time+wait%22&hl=en&lr=lang_en|lang_de&ie=UTF-8
Ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2003 07:00 AM
тАО04-11-2003 07:00 AM
Re: Socket & IP (timeout)
PHNE_26771
and
PHKL_22840/PHKL_25613
http://www2.itrc.hp.com/service/patch/mainPage.do
See if anything in them looks like it might be causing your problem.
Ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2003 05:41 PM
тАО04-11-2003 05:41 PM
Solutionunless the connections were "active" at the time the cable was disconnected - that is to say actively trying to transmit data, unless you explicitly close them, they will remain in ESTABLISHED _forever_ _UNLESS_ you have used setsockopt() to set SO_KEEPALIVE, at which point the tcp_keepalive_interval comes into play (along with tcp_ip_abort_interval)
if your software has timed-out on its own on a socket, it really Really, REALLY aught to go ahead and call close() on the socket(s)...