|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello everybody,
I have a problem receiveing data on a TCP socket. I am sending a binary struct over and when receiveing it I found a lot o bytes containg 0 inside at the begining. Practically I send 259 bytes, the first 255 bytes form a string and the last 4 are an integer. When calling recv I get the correct number of bytes (259 in this case), but the first about 100 bytes contain only 0 values, the corect string content starts at byte 101 (surely enough i don't get the final part of the string and neither I get the integer). Anyone has a solution for this kind of situation? It seems I get some kind of reset or keep-alive and that the first 100 bytes are those... Thanks a lot, Rumburak. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
In article <f7f70e5a-ac7b-46c7-9c0c-7266cd602a24@e1g2000hsh.googlegroups.com>,
Rumburak <bota.florin@gmail.com> wrote: > I have a problem receiveing data on a TCP socket. I am sending a >binary struct over and when receiveing it I found a lot o bytes >containg 0 inside at the begining. Practically I send 259 bytes, the >first 255 bytes form a string and the last 4 are an integer. When >calling recv I get the correct number of bytes (259 in this case), but >the first about 100 bytes contain only 0 values, the corect string >content starts at byte 101 (surely enough i don't get the final part >of the string and neither I get the integer). > Anyone has a solution for this kind of situation? There is a possibility that your problem is some kind of C array issue, but without code we can't really say. Generally speaking, TCP and recv() are operating system specific, not part of standard C, so if the problem is on the network side then you will need to consult an os-specific newsgroup to investigate the networking. (MS Windows sockets work a bit differently than Unix sockets for example.) -- "All is vanity." -- Ecclesiastes |
|
![]() |
| Outils de la discussion | |
|
|