Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!rochester!pt.cs.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!ea08+ From: ea08+@andrew.cmu.edu (Eric A. Anderson) Newsgroups: comp.lang.perl Subject: Multiple simultaneous accepts with an array. Message-ID: Date: 29 Apr 91 17:10:28 GMT Organization: Carnegie Mellon, Pittsburgh, PA Lines: 26 I got no responses the last time I think I sent this out, and there were problems with the netnews software at andrew at about that time, so on the assumption that this did not succesfully make it out, I will post it again. -------------- I am writing a program which I want to have listen on a port, and when it gets connections, keep adding all the connections to a list. So I wrote the following line : ($addr = accept($DataSock[++$#DataSock],CONNSOCK)) || die $!; Now what happens when this runs is that the first connection is opened fine, but when a second connection comes in, the first one is killed. I have also noticed that this doesn't work : print fileno($one) . "\n"; $test = $one; print fileno($test) . "@@\n"; Where one has acceptedon the port. The fileno is printed for one, but nothing is printed for test. Is there any easy way to deal with this? -Eric ********************************************************* "My life is full of additional complications spinning around until it makes my head snap off." -Unc. Known. "You are very smart, shut up." -In "The Princess Bride" *********************************************************