in reply to socket read buffer full

You can use the select on socket handler, which will let you know whether the socket is ready for read or write. Based on the select output you can perform read or write operation.

Replies are listed 'Best First'.
Re^2: socket read buffer full
by targetsmart (Curate) on Jan 07, 2009 at 08:42 UTC
    This question is ignoring reads, to avoid blocking.

      spmlingam's answer does address your problem. When B is about to write, use select to check if there's anything to read. If there's is, read until there isn't. Then proceed to write.

      sathiya.sw's shutdown solution sounds more promising, though.

        As I already said in my earlier post, I did the select and read already.
        I predicted that the read side of the socket is full in B side, so I started to read the data from B's side also apart from writing, the problem got solved.
        The shutdown method worked. Thanks for that solution.
        One more question
        Even after shutting down the read side of the B socket, the B's socket->can_read is saying that some data is available for reading(but doing a <Bsocket> returns undef), why it is like this?.