Hi, When sending data out of the socket I don't see in the code where the sb_cc is incremented.
Is the socket send performed in the same thread of execution or the data is copied on to the socket send buffer and a different thread then sends the data out of the socket? Because, I see a call to sbwait(&so->so_snd) in the sosend_generic and I don't understand who would wake up this thread? If the data is not copied on to the socket buffers then it should technically send all data out in the same thread of execution and future socket send calls should see that space is always fully available. In that case I dont see a reason why we need to wait on the socket send buffer. As there would no one who will actually wake you up. if (space < resid + clen && (atomic || space < so->so_snd.sb_lowat || space < clen)) { if ((so->so_state & SS_NBIO) || (flags & MSG_NBIO)) { SOCKBUF_UNLOCK(&so->so_snd); error = EWOULDBLOCK; goto release; } error = sbwait(&so->so_snd); SOCKBUF_UNLOCK(&so->so_snd); if (error) goto release; goto restart; } In the above code snippet, for a blocking socket if the space is not available, then it may trigger a deadlock? please clarify. -- Thanks, Vasanth _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"