[En-Nut-Discussion] Timing and Receiving Data Problem for TCPServer

Dusan Ferbas dferbas at etech.cz
Mon Feb 5 23:27:34 CET 2007


Hi,

I disagree with this claim.

Usually (Berkeley standard), you can set expedited and non expedited 
socket modes. Expedited means, that data, you sent from application 
layer, are immediately sent over a network. I.e. there is a packet 
that can be received e.g. by NutTcpReceive(...) call. I assume no 
streaming, as it is used e.g. in Nut/OS httpd example. The mechanism 
of buffering is called Nagle algorithm.

I have an application of telnet server (Pacific Softworks TCP stack), 
where VT100 codes are used to format a screen - since 1999 :-), 
that's why it was ever implemented. And there is a need for immediate 
response. I achieve this with a call to set socket option API 
(IPPROTO_TCP layer, TCP_NODELAY option)

Macro definition for TCP_NODELAY already exists in Nut/OS ...

At 12:29 5.2.2007, you wrote:
>From: "Clemens Kirchgatterer" <c.kirchgatterer at amatic.com>
>...
>maybe one thing that adds to the confusion is, like you correctly
>pointed out, that TCP is a stream and not a packet oriented protocol to
>begin with. so to clear this up: using tcp you can be sure, that you get
>all your data, without corruption and in the right order. on the other
>hand, you must check for message boundaries on the application level.
>i.e. if you put first 3 bytes on the wire and then 5, you may get all 8
>bytes in one read() on the receiver side, or 2 times 4 bytes or any
>other combination that sums up to 8. :-)
>
>best regards ...
>clemens

Dusan 




More information about the En-Nut-Discussion mailing list