in reply to Perl Sockets question

then closeing the socket, but this didnt really work

What do you mean by "didn't really work"?

If you open the socket before each line, and close it after the line, each connection will only transport one line. Is that the desired behaviour?

Edit: what you probably need is autoflushing the $sock. IO::Socket says As of VERSION 1.18 all IO::Socket objects have autoflush turned on by default. This was not the case with earlier releases. So which version of IO::Socket are you using?

(And please but <code>...</code> tags around your example code.)

Replies are listed 'Best First'.
Re^2: Perl Sockets question
by jimbo (Initiate) on Feb 08, 2008 at 23:16 UTC
    sorry about the bit :-) I am not 100% sure about what version I am using. I am using perl version 5.8.8 if thats any help. how can I tell what version f IO::Socket I am using? If I DO put the open and close around the  print socket$ $line it just outputs empty strings which is what I was meaning byt "didnt really work" Thanks, jeremy
      perl -MIO::Socket -e 'print "$IO::Socket::VERSION\n"'
        I got 1.29 returned. OK, well the interesting thing is, as per my last post, the client I Was using was less than helpful, because infact when I wrote another client using a different control, it all worked fine ! HOWEVER.....it seems to output one lot of data, then I endup with a heap of spaces (hex 20) then I get the rest of the data. i.e. one part of hte data comes out, a heap of spaces, then the last of the data. There is quite a bit of data being output tho. If I output the serial data at the same time, the data is fine. I cant figure it out. Any Idea why I would getting the extra spaces? Jeremy