[En-Nut-Discussion] TCPSend thread safe

Nicolas Moreau moreau at gmail.com
Thu May 15 10:43:35 CEST 2008


Thanks for you reply, I understand how the threading works.
My questions related more to the TCP state machine, what happens for
example if the RX is sending the ack for some data it just received
and the send thread starts sending one.
Will the state machine cope ? Or will the ACK and my send get mixed up ?

Thanks

Nic


On Thu, May 15, 2008 at 4:35 PM, Lasse conrad <lasse.conrad at aab60.dk> wrote:
> Hi Nic
>
> I had a similar problem. It sound like you have a design in need of some
> async communication. Maybe choose UDP instead? I find TCP more suited
> for Request response senarios.
>
> I.e.
>
> PC --> TCP (Request some data)  --> Embedded device
> PC <-- TCP (Response with data) <-- Embedded device
>
> I think your need is like this. Lets say you need from a PC to increase
> a setting in your embedded device.
>
> PC --> TCP (Request some data)  --> Embedded device
> PC <-- TCP (Response with data) <-- Embedded device
>
> PC <-- UDP (Spontanous data unrelated to the data in the TCP
> request/response senario <-- Embedded device
>
> PC --> TCP (Request some other data)  --> Embedded device
> PC <-- TCP (Response with other data) <-- Embedded device
>
>
> But to answer your question. In NutOS you must release your treads your
> self for another task to take over. Its only interrupts which can well
> interrupt :-) your tread execution. But the problem is you must make
> sure the TCP session is open in your receiving task, before your sending
> task uses the TCP socket.
>
> Try this design instead.
>
>
> -----Original Message-----
> From: en-nut-discussion-bounces at egnite.de
> [mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of N
> Sent: 15. maj 2008 07:57
> To: en-nut-discussion at egnite.de
> Subject: [En-Nut-Discussion] TCPSend thread safe
>
>
> Hi
>
> Can I have 2 threads one waiting on a NutTcpReceive and another sending
> data for the same TCP socket ? I can't find any comments in the code
> that say otherwise but prefer to be sure
>
> Thank you
>
> Nic
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.524 / Virus Database: 269.23.16/1432 - Release Date:
> 14-05-2008 07:49
>
>
>



More information about the En-Nut-Discussion mailing list