Thread: sendto() returns wrong bytes sent

  1. #1
    Registered User
    Join Date
    Oct 2009

    sendto() returns wrong bytes sent

    Hi everybody, the problem is basically what's on the title. sendto() always return 0 but in the other side the complete message is completely received... its a communication between two servers so they are binded to respective ports...

    both are running in the same local machine.

    If anyone as a clue what it might be, please just give me a hint

    thanks in advance
    Last edited by tmcp; 03-08-2011 at 10:07 PM.

  2. #2
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Katy, Texas
    A variable scope issue?
    Mac and Windows cross platform programmer. Ruby lover.

    Quote of the Day
    12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.

    Amen brother!

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    New Zealand
    My magic 8-ball ball says ... "you need to post code".
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    My guess is
    result = ( sendto() != numbytes )

    Rather than
    ( result = sendto() ) != numbytes

    In other words, the number of bytes is the result of a boolean expression, and not the actual result from sendto()
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory leaks problem in C -- Help please
    By Amely in forum C Programming
    Replies: 14
    Last Post: 05-21-2008, 11:16 AM
  2. Page File counter and Private Bytes Counter
    By George2 in forum Tech Board
    Replies: 0
    Last Post: 01-31-2008, 03:17 AM
  3. a function that returns the number of bytes of a file
    By paulovitorbal in forum C Programming
    Replies: 22
    Last Post: 05-15-2006, 06:01 PM
  4. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM
  5. Reading Certain number of bytes from a file
    By (TNT) in forum Windows Programming
    Replies: 6
    Last Post: 01-14-2002, 08:35 PM