Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: TCP server sends just part of my packet

by hdb (Monsignor)
on Apr 16, 2013 at 12:05 UTC ( [id://1028884]=note: print w/replies, xml ) Need Help??


in reply to TCP server sends just part of my packet

Your client is not reading all the server has to say! Try:

$/ = undef; my $answer = <$socket>;

or do

while( $answer = <$socket> ) {

There must be an end of line character in your message at byte 482.

Replies are listed 'Best First'.
Re^2: TCP server sends just part of my packet
by roboticus (Chancellor) on Apr 16, 2013 at 12:30 UTC

    hdb:

    It's just as you said:

    470: 04 cb c0 00 00 12 00 00 28 af
    480: 00 01 0a 26 0f 0b 00 00 00 00
    490: 00 05 c0 00 00 25 00 00 28 af
    500: 39 39 2d 31 33 39 32 31 46 37

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

      Thx, now I understand it better, 0x0a is the sign. When it appears in data stream, it confuses the interpretation.

Re^2: TCP server sends just part of my packet
by microcx (Initiate) on Apr 16, 2013 at 12:57 UTC

    Bravo!! I've taken your first piece of code and it's now working like a charm. Great job @hdb. In fact, the dumpfile I got (using tcpdump) from server's interface showed that only 482 bytes were sent and that misled me into thinking that the client worked properly and it was the server to be blame.

    Line 0220: (|last 5 bytes I got|28 af 00 01 0a) 26 0f 0b

    To make it clear, starting from 0x26, the packet is lost, so you believe that my client considers maybe this byte is the end of line? By the way, what represents the '\n' in packet transmission?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1028884]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-26 02:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found