[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Q] About block/nonblock TCP Sending in ns2
On Mon, 06 Sep 1999 19:35:28 CDT, [email protected] wrote:
>Gurus:
> Hi, I'm wondering whether the current implementation
>of TCP application sending function is in block mode or
>unblocked mode. Say, if I do a "send" in TcpApp of ns2,
>can I expect this call will be blocked until the sending
>of the message accomplished or the function call will
>return immediately as an asynchronous send in socket?
>If it was the latter case (unblocked), then how could I
>find out the queue length of the underlying Tcp protocol
>so that in the application could I know whether I could
>inject more data to the TCP or not.
Ns is event driven, not threaded.
The data will be forwarded until it would block, then it will be
queued as another event and execution will continue after send().
As in the real world, you cannot easily find out the amount of data
queued on an outgoing TCP link. You can get callbacks when the queue
is empty, though. See the done{} method to TCP agents.
-John Heidemann