Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Read Socket data on data, not return

by steves (Curate)
on Dec 22, 2004 at 09:40 UTC ( #416730=note: print w/replies, xml ) Need Help??

in reply to Read Socket data on data, not return

It seems more likely that the server you're connecting to is not actually sending the data until a carriage return is issued there. In other words, no matter how your client tries to read the data, it can only get anything if the server has actually written a packet to the socket. Depending on how the socket is being used in the server, the data may be buffered and may not actually be written to the underlying socket until a carriage return is issued.

Can you post some example server code?

  • Comment on Re: Read Socket data on data, not return

Replies are listed 'Best First'.
Re^2: Read Socket data on data, not return
by ecuguru (Monk) on Dec 23, 2004 at 02:40 UTC
    The entire server working code is in the first link: here
    I'm only using telnet as the client, which is sending in every character.
    client = telnet localhost 2323


      Does your local telnet client tell you it's operating in character and not line mode? telnet can operate in either. I find that when I connect to non-telnet servers, my telnet client is in line mode, which would explain why your server is "waiting" for newlines -- it's actually only seeing full lines from the client, not characters. To see your telnet client's current mode, escape into telnet command mode and issue the status command.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://416730]
[Your Mother]: Stick with what you know. Or post a SOPW and if it's not complicated I guarantee someone will answer; me if it's straightforward and no one else gets it better first.
[1nickt]: ++YourMother (Grammar Vigilante of Bristol)
[Lady_Aleena]: Um, how does grep do multiline? print "$file:$_" if grep { /get_(array|hash| data)\(.+\)/ } $_; only returns the same 18 lines the command line grep does.
[Lady_Aleena]: my scratchpad has what I have so far.
[choroba]: what do you mean by multiline?
[Discipulus]: thanks 1nickt!
[choroba]: grep is a filter, it selects elements from a list based on a boolean condition
[moritz]: you need to read the file in one go to do a multiline regex match
[erix]: ha ha, I like the Vigilante
[Lady_Aleena]: Forget it. I'm getting angry with it.

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (12)
As of 2017-05-23 19:49 GMT
Find Nodes?
    Voting Booth?