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

Problem while sending input to the serever using telnet

by murugaperumal (Sexton)
on Jul 05, 2010 at 05:38 UTC ( #848014=perlquestion: print w/replies, xml ) Need Help??
murugaperumal has asked for the wisdom of the Perl Monks concerning the following question:

I have written the server program using the select to handle multiple clients. That is run successfully. I have written the client program also to connect the server. That also run successfully.

But if connect the client to the server using telnet it is connected successfully. But if I give the input length as 5 character including newline, in the server side it displayed the length as 6 character. Then if I print some value that value also replaced. I am not able to get the correct value.

How can I solve this problem. Why it is add more character to the given input. Why it is remove some character in the STDOUT.

20100707 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips

  • Comment on Problem while sending input to the serever using telnet

Replies are listed 'Best First'.
Re: Problem while sending input to the serever using telnet
by cdarke (Prior) on Jul 05, 2010 at 07:42 UTC
    Is Microsoft Windows involved? Windows implementations will add a "\r" if you are sending text. This can be avoided by using binmode on the file handle.

    That is assuming you are using a filehandle. I have to guess here, because you don't show any code.
Re: Problem while sending input to the serever using telnet
by ikegami (Pope) on Jul 05, 2010 at 07:43 UTC

    [ Please don't use <pre>, especially not for your entire post. Use <p> at the start of every paragraph and wrap computer text (code, data, etc) in <c>...</c>. ]

    What 5 characters, 6 characters and 5 characters are those?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://848014]
Approved by planetscape
[Discipulus]: good morning nuns and monks!
[marioroy]: Morning Discipulus. porting C code to Perl is an interesting problem for running parallel. I will try and the reason for attempting Perl code to match C 100%.
marto waves

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2017-10-24 07:08 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (286 votes). Check out past polls.