Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!zephyr.ens.tek.com!tektronix!sequent!mntgfx!ikhan From: ikhan@mentor.com (Iqbal Khan) Newsgroups: comp.unix.questions Subject: Client/Server using Sockets?? Message-ID: <1990Dec31.184521.6502@mentor.com> Date: 31 Dec 90 18:45:21 GMT Organization: engr Lines: 34 I am using unix sockets for a client server modem. On the server side I am using 'listen' and 'accept' for connections and on the client side I am using 'connect'. My problem is that I want to allow only one connection at a time. This means that if the server has accepted a connection, all other connections should be refused, instead of being put in the queue. I have tried using 'backlog' of 0 in the 'listen' command but it did not solve the problem. Here are a few lines on the server side: /****************************************************************/ if (listen(sock,0) < 0) { /* backlog is zero */ perror("listening for connections"); close(sock); exit(1); } ... msgsock = accept(sock,(struct sockaddr *) &addr,&len); /****************************************************************/ I would appreciate any suggestions. Please send e-mail to 'ikhan@mentor.com' or 'khan@iuvax.cs.indiana.edu'. Thanks in advance. Iqbal Mustafa Khan 503-626-7000 (x7256) P.S. My platform is apollo and O.S. verison 10.3. -- Iqbal Mustafa Khan