home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.solaris:505 comp.sys.sun.apps:3125
- Path: sparky!uunet!ukma!bogus.sura.net!howland.reston.ans.net!usc!news.service.uci.edu!ucivax!schmidt
- From: schmidt@liege.ics.uci.edu (Douglas C. Schmidt)
- Subject: different semantics for listen(2)
- Nntp-Posting-Host: liege.ics.uci.edu
- Message-ID: <2B6854CB.19235@ics.uci.edu>
- Newsgroups: comp.unix.solaris,comp.sys.sun.apps
- Reply-To: schmidt@ics.uci.edu (Douglas C. Schmidt)
- Organization: University of California at Irvine: ICS Dept.
- Lines: 33
- Date: 28 Jan 93 21:49:00 GMT
- Distribution: inet
-
-
- Hi,
-
- I just finished porting the TCP benchmark test program "ttcp"
- to Solaris 2.1. As a result of this, I learned an interesting and
- subtle difference between the semantics of the BSD listen(2) system
- call in both systems. It is worth remembering in case you are porting
- old BSD socket code to Solaris, so I'd like to share it.
-
- In the ttcp source there is the following comments and code:
-
- ----------------------------------------
- /* otherwise, we are the server and
- * should listen for the connections
- */
- listen (fd, 0); /* allow a queue of 0 */
- ----------------------------------------
-
- In Sun OS 4.1.x this idiom seems to work fine. However, with
- Solaris 2.1 having a 0-sized listen queue causes the server to reject
- client connection requests. Changing the value to 1 fixes the
- problem... After reading the manual page it is unclear which is the
- "correct" behavior. Although it certainly seems plausible that Solaris
- is doing it "right" there is an issue of backwards compatibility here!
-
- Hope this helps someone out someday!
-
- Doug
- --
- Douglas C. Schmidt
- Department of Information and Computer Science
- University of California, Irvine
- Irvine, CA 92717. (714) 856-4105
-