Loading ...
Sorry, an error occurred while loading the content.

Re: [extremeperl] IO::Socket:INET Client problem

Expand Messages
  • Tom Brown
    I think Rob s answer was backwards... e.g. the read side of things, not the write (print) side of things, but it isn t very clear where the problem lies. His
    Message 1 of 4 , Dec 23, 2002
    • 0 Attachment
      I think Rob's answer was backwards... e.g. the read side of things, not
      the write (print) side of things, but it isn't very clear where
      the problem lies. His answer is quite correct <> isn't the normal
      way to grab data from a socket... it is meant for line oriented
      input...

      I think you're just looking for

      my $old = select $socket;
      $| = 1;
      select $old;

      which changes the filehandle to no longer be buffered. You may
      need to run it for STDOUT too.

      -Tom



      On Mon, 23 Dec 2002, diarmuid_obriain <diarmuid_obriain@...> wrote:

      > I have a problem with a TCP Client I am working with. It works fine
      > if the data on the server that is being sent to the socket has
      > a '\r\n' at the end of the line however if it does not then that line
      > is not printed until after the next \r\n action. This basically makes
      > it impossible for the client to see a command prompt from the server
      > which would naturally not have the \r\n at the end of the line. Is
      > there any way in Perl of forcing the client to print the contents of
      > the buffer without waiting for the \r\n sequence.
    Your message has been successfully submitted and would be delivered to recipients shortly.