Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Perl Sockets


ghost's Avatar
0 0

How do I make a listening socket that can accept multiple connections simultaneously?

Thanks in advance for any help


ghost's Avatar
0 0

In your listen option, do this:

Listen => 10,

//rest

That specifies the maximum number of connections allowed. If it goes above 10 it will give you an error of some sort.

upon further research, it might also be:

Listen => SOMAXCONN,

I donno my perl is rusty haven't used it in ages :@:|


ghost's Avatar
0 0

Ok, I think that worked except now my problem is that the second connection doesn't do anything. Any tips?

Basically, my sourse does the following.

Include packages. Declare socket Do the socket->accept thing Use the connection

but the second connection just does nothing.