Thread: socket write synchronization

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    134

    socket write synchronization

    I am writing two times on a socket, and reading it two times from the socket from other end..

    i.e one write then read then write then read.. I don't know what is happenenning the two write operation goes faster I thing and I can read only once.. what could be the problem? anybody encountered with such problem?

  2. #2
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    There's nothing wrong there. TCP (again, I'm assuming you're using TCP) doesn't guarantee that one packet is read before the next one written. It only guarantees they arrive in order.

  3. #3
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    And by the way, these are no longer C questions, but network programming questions, so please start posting in the appropriate board. Thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why the local socket program occur core dump?
    By chenayang in forum Linux Programming
    Replies: 16
    Last Post: 08-16-2010, 08:39 AM
  2. [RTYPE] Server / Client Game synchronization
    By +Azazel+ in forum Game Programming
    Replies: 1
    Last Post: 12-10-2009, 05:45 PM
  3. SSH Client Socket
    By shawon in forum Linux Programming
    Replies: 5
    Last Post: 10-28-2009, 04:01 AM
  4. Slight problem with socket reading!!!
    By bobthebullet990 in forum C Programming
    Replies: 5
    Last Post: 02-15-2006, 09:55 AM
  5. Socket Help - Multiple Clients
    By project95talon in forum C Programming
    Replies: 5
    Last Post: 11-17-2005, 02:51 AM