Re: Sockets not working properly

From: Fletcher Glenn (fletcher_at_removethisfoglight.com)
Date: 04/30/04

  • Next message: Barry Margolin: "Re: Is this is an alarm or a signal handler"
    Date: Fri, 30 Apr 2004 17:37:30 GMT
    
    

    George wrote:
    > Hi all. I've developed a simple client/server program using sockets for
    > sending some characters.
    >
    > Well, the problem is that everything works perfectly except the last
    > send/recv pair. If I print the last message received, it displays
    > nothing. And what's more, the same program running in different computers
    > behaves different. There're computers where that last message is printed.
    >
    > I've sniffed the network using ethereal and the data is transmitted in
    > every case.
    >
    > Any idea why although the info is really transmitted, it's not received
    > ok by the program?

    I hope you're not sending strings, and then trying to use the
    null character as a message boundary. If you are, you are
    ignoring the fact that a tcp socket connection is a
    stream, and there is no restriction on whether or
    not a single receive may contain the contents of one
    or more sends.

    --
    Fletcher Glenn
    

  • Next message: Barry Margolin: "Re: Is this is an alarm or a signal handler"

    Relevant Pages

    • Sockets not working properly
      ... I've developed a simple client/server program using sockets for ... sending some characters. ... send/recv pair. ... There're computers where that last message is printed. ...
      (comp.unix.programmer)
    • Sockets not working properly
      ... I've developed a simple client/server program using sockets for ... sending some characters. ... send/recv pair. ... There're computers where that last message is printed. ...
      (comp.lang.c)
    • Sockets not working properly
      ... I've developed a simple client/server program using sockets for ... sending some characters. ... send/recv pair. ... There're computers where that last message is printed. ...
      (comp.os.linux.networking)
    • Re: Sockets not working properly
      ... I've developed a simple client/server program using sockets for ... > sending some characters. ... "Outside of a dog, a book is a man's best friend. ...
      (comp.lang.c)
    • Re: OT: Why do so many forms require numbers be entered without hyphens or spaces?
      ... Because computers are supposed to serve human beings, ... These are typically stored in databases without any of the extraneous characters. ... Different countries have different formats for phones - and typically like to see the phone numbers in their own format, not a string of numbers or the U.S. format. ... If a program requires its users to input data in a form other than the formthose userare accustomed to using, and cannot perform such simple adaptations as stripping out common punctuation characters, then that program has been incompetently designed and coded. ...
      (comp.lang.php)