PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > Problem with recv on TCP socket
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Problem with recv on TCP socket

Réponse
 
LinkBack Outils de la discussion
Vieux 23/11/2007, 15h09   #1
Rumburak
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Problem with recv on TCP socket

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.
  Réponse avec citation
Vieux 23/11/2007, 16h31   #2
Walter Roberson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Problem with recv on TCP socket

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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h48.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08161 seconds with 10 queries