xelwarto has asked for the wisdom of the Perl Monks concerning the following question:

Using IO::Socket::INET to connect to a server on another machine. The Connection works and the server can recievie the data when the client closes the connection. I need to have the data sent before the connection is closed (real Time) so that the server can process the request and send something back. Some one had mentioned about flushing the buffer, but that does not seem to work.

Replies are listed 'Best First'.
Re: IO Buffering
by simeon2000 (Monk) on Aug 12, 2002 at 13:18 UTC
    Unless you offer a code sample, the best solution that can probably be offered is:

    use FileHandle; $sock->AUTOFLUSH = 1;

    This is the most reliable way to send/recv data in "real Time".

    --
    perl -e "print qq/just another perl hacker who doesn't grok japh\n/"
    simeon2000|http://holdren.net/

Re: IO Buffering
by derby (Abbot) on Aug 12, 2002 at 13:23 UTC
    How are you flushing the buffer? Are you sure you're doing that correctly (a code snippet would be nice). There are a whole bunch of methods devoted to flushing - autoflush, flush, printflush. Are you having issues with these?

    -derby