[En-Nut-Discussion] TCPSend thread safe

Lasse conrad lasse.conrad at aab60.dk
Thu May 15 08:35:02 CEST 2008


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