sendto() returns wrong bytes sent

This is a discussion on sendto() returns wrong bytes sent within the C Programming forums, part of the General Programming Boards category; Hi everybody, the problem is basically what's on the title. sendto() always return 0 but in the other side the ...

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    17

    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
    Location
    Katy, Texas
    Posts
    2,309
    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
    Location
    New Zealand
    Posts
    6,308
    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
    Location
    The edge of the known universe
    Posts
    32,855
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 12:16 PM
  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, 07:01 PM
  4. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 02: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21