Path: utzoo!utgpu!watmath!att!dptg!holin!bes From: bes@holin.ATT.COM (Bradley Smith) Newsgroups: comp.unix.questions Subject: Re: Socket programming examples wanted Keywords: socket IPC help Message-ID: <779@holin.ATT.COM> Date: 20 Oct 89 17:51:25 GMT References: <101@tw-rnd.SanDiego.NCR.COM> <430@cscnj.csc.COM> Reply-To: bes@holin.ATT.COM (Bradley Smith) Organization: AT&T Bell Labs, Holmdel, NJ Lines: 60 In article <430@cscnj.csc.COM> paul@cscnj.csc.COM (Paul Moody) writes: >I dont know what flavor of tcp/ip you are using, but all three that >we work with say 'DONT USE SELECT'. Instead use a blocking accept >and set an alarm. I don't know about this, I have used select to detect when to do an accept, below is some dumb code to show how one might do it. This way you could/can (if you want) have the server do it all (provided that the clients don't keep it that busy). But it is a way to show how to do it. FYI - the below code is for UNIX domain sockets, but INET work the same way. ================ here: do { a2 = 1 << s1; /* get first one */ for(i=0;i 0) { printf("tcpsink: %d characters where received\n" ,hismsglen); }else { sret = errno; perror("Recv failed!"); printf("errno = %d\n", sret); close(ns[i]); ns[i] = 0; } } } -- Bradley Smith Telecommunications Solutions Development AT&T Bell Labs, Holmdel, NJ 201-949-0090 att!holin!bes or bes@holin.ATT.COM