This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Perl threads and UNIX sockets

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:

use threads;
use Socket;

unlink ("/tmp/mysock");

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);

sub con_thread {
   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:

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]