X-Spam-Check-By: sourceware.org X-YMail-OSG: s4rZVz0VM1l5YN15ULvwJZAn5m0WrSx3FgleOYHCAnj2xJqFOGxFDIUjBe0jMeoZYazv_ZQ8Kv9yMDwcomJX0dqa8stZK0xlIrezZhF4JwBAkO5SWq_cdPqkEfxIuw9qNOqF4vRFsqfR Message-ID: <45BCE2AE.5090504@yahoo.de> Date: Sun, 28 Jan 2007 18:51:42 +0100 From: Sebastian Weber User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Perl threads and UNIX sockets Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Hi all, I found a problem in the current cygwin perl (v5.8.7 built for cygwin-thread-multi-64int): The following code sets up a UNIX domain socket server and connects to that server in a different thread. It will block forever exactly at the connect / accept calls: #!/usr/bin/perl use threads; use Socket; unlink ("/tmp/mysock"); $t=threads->create("con_thread"); socket (SOCK1,PF_UNIX,SOCK_STREAM,0) or die "socket(): $!"; bind (SOCK1, sockaddr_un("/tmp/mysock")) or die "bind(): $!"; listen(SOCK1,SOMAXCONN) or die "listen(): $!"; accept (CLIENT,SOCK1); $t->join(); sub con_thread { sleep(2); socket(SOCK2, PF_UNIX, SOCK_STREAM, 0) or die "socket(): $!"; connect(SOCK2, sockaddr_un("/tmp/mysock")) or die "connect(): $!"; } This code will _not_ block using perl v5.8.7 on Linux or HPUX. Is this a bug? Is there a workaround? Greets, Sebastian ___________________________________________________________ Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/