Help with IO::socket simultaneous read and write

S

Steve D

I've created an application that opens sockets (using IO::Socket) and
then creates two ithreads, one that reads the socket and one that
writes it. It appears that if there is a "read" pending (sysread,
recv, or read) on a socket, then a "write" (syswrite, send or print)
on that socket hangs.

(In fact, it appears that if there is a "read" on *any* socket file
handle, then a "write" on any other hangs, but I need to verify that
carefully).

Before I put the reader's in, the writers were working just fine.

Is this known behavior with sockets?

How about with IO::Socket?

I'm trying to determine if there is a bug in my code, or if this is
known behavior.

Any good solutions?

Would IO::Select on the file-handle's in the reader's suffice to keep
the file-handle's clear for the writers to succeed?

Or will that fail too (if IO::Select somehow locks a file-handle).

Would Socket work better than IO::Socket without doing a select?

Regards,
Steve D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top