in reply to Re: (podmaster) Re: Reading and writing sockets
in thread Reading and writing sockets

The protocol is already fixed... - who "fixed" it? who designed it? why? trying to remedy design flaws is a bad way to write programs.

I need to be client AND server. - that's possible, but first you need to clearlyl define your protocol, as I haven't a clue as to what it is(send command, get response is not specific enough). How do you distinguish a command from a response?

But how do I stop reading from a socket when I have to send something? - as far as I know, you can't. you wait till the socket times out. That is why you're supposed to read data in chunks, like in a while loop.
read FILEHANDLE,SCALAR,LENGTH,OFFSET
read FILEHANDLE,SCALAR,LENGTHwhile(read(FH,$rr,1024,$off){...

I need to know more about what the actual protocol looks like.
 

____________________________________________________
** The Third rule of perl club is a statement of fact: pod is sexy.

  • Comment on Re: Re: (podmaster) Re: Reading and writing sockets