Article View: comp.os.os2.programmer.misc
Article #195Re: Sockets prog problems/questions; recv stays blocked when other end dies
From: Yuval Zalkow
Date: Wed, 29 Mar 1995 00:00
Date: Wed, 29 Mar 1995 00:00
38 lines
2535 bytes
2535 bytes
In article <3lc25d$kt1@cpcug.org>, kbennett@cpcug.org (Keith Bennett) writes: >The following questions pertain to programming sockets using >IBM's TCP/IP for OS/2 version 2.0 (UN 64092). Our app is >running under OS/2 2.1 (not 2.11) and we hope to eventually >upgrade to Warp. > >We have found that when doing a blocking read (recv()) on a >socket, the read will not return if the machine on the other end >of the socket has been switched off or rebooted. (Despite our >warnings, our customers do it from time to time and we have >decided to accommodate for that somehow in our software.) [stuff deleted] > reliable than ping (tcp vs. udp) and that sending messages > across an open socket would require less overhead than ping. > (Is that correct?) > >Thanks for any help... >- Keith Ping doesn't use UDP, Ping uses ICMP, which is at the IP layer in the protocol stack. Therefore Ping would have less overhead than either type of socket that you mention, TCP or UDP. Ping just sends an ICMP request for echo packet. In this packet it puts the time it sent it. When the packet arrives it calculates the round trip. To get at ICMP you could create a RAW socket. This allows access to IP and ICMP. It doesn't make a difference which you use though. ICMP should have less overhead, but everything will be required to time out if the echo is returned. IP is conectionless and therefore can't tell when a machine is up or went it isn't. (Try running an ATM network is that's important, if you can afford it of course.) As for your problem, I don't really know the best way to deal with that. I think you're on the right track, some type of watchdog timer system. But I don't know enough about TCP/IP OS/2 programming to say much. Chris --------------- cinacio@vt.edu
Technical Details
Message-ID:
<3lc3t6$88@solaris.cc.vt.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3lc25d$kt1@cpcug.org>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 106983,d2ec22b1757b70e6 X-Google-Attributes: gid106983,public X-Google-Thread: 11307a,d2ec22b1757b70e6 X-Google-Attributes: gid11307a,public X-Google-Thread: 10cd94,d2ec22b1757b70e6 X-Google-Attributes: gid10cd94,public From: yzalkow@birch.ee.vt.edu (Yuval Zalkow) Subject: Re: Sockets prog problems/questions; recv stays blocked when other end dies Date: 1995/03/29 Message-ID: <3lc3t6$88@solaris.cc.vt.edu> X-Deja-AN: 100531504 distribution: world references: <3lc25d$kt1@cpcug.org> organization: Virginia Tech reply-to: yzalkow@birch.ee.vt.edu newsgroups: comp.os.os2.programmer.misc,comp.os.os2.networking.tcp-ip,bit.listserv.os2-l