Thread: TCP/IP Send-Q

  1. #1
    Gavin Kreuiter
    Guest

    TCP/IP Send-Q

    I have an ESTABLISHED socket connection between two applications on two systems. The client app performs a successful socket write(), but the server app (sometimes) does not receive the data. Not surpising, because netstat shows that the local Send-Q contains the data.

    Stevens says that this only happens if Nagel is disabled (not applicable), or if the remote receive Q is full (not true). So what else could be the problem? Network hardware? The connect() *always* succeeds, but data is *sometimes* sent, and *sometimes* held in the local TCP Send-Q.

  2. #2
    Registered User rohit's Avatar
    Join Date
    Feb 2002
    Posts
    69
    not 100% sure

    if you are using ioctl(reuseaddr) then are you using SO_LINGER in the set sockopt.

    how many hops are the clients and the server away...any routers in between . kind of network ?? .

    if the connection is establised and you are using tcp protocols then it is not possible generally that you get the wrong confirmation . it's a threesome i mean three way communication.

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    1

    Thumbs up

    Usually, a server will fork() after accept() to process multiple connections. In that case, writing to a socket will be handled at the TCP layer, so that the remote host will have data in the Recv-Q until the child performs a read.

    This server was only handling a single connection (although still calling listen() with the typical backlog of 50). Because an accept() was NOT being made for the SECOND connection, the data remained in the Send-Q of the local host.

    QED
    (but took a long time to solve)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. tuncated uint8_t
    By Coens in forum C Programming
    Replies: 14
    Last Post: 11-24-2008, 07:57 AM
  2. TCP/IP Sockets in C (problem with send() and recv(): how to loop them)
    By ferenczi in forum Networking/Device Communication
    Replies: 3
    Last Post: 11-18-2008, 07:38 AM
  3. sending n no of char data uning send() function,
    By thebrighter in forum Windows Programming
    Replies: 1
    Last Post: 08-22-2007, 12:26 PM
  4. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  5. LISP (DrScheme) any one?
    By Jeremy G in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 03-31-2004, 12:52 PM