Friedrich
Friedrich

Reputation: 645

One write-thread, one read-thread on the same socket?

i am running eCos with the FreeBSD TCP/IP-stack. Is it safe to have two threads running one to read from a socket and one to write to the same socket?

Well i guess since its the FreeBSD stack the operating system does not matter.

Best regards,

Friedrich

Upvotes: 2

Views: 3933

Answers (1)

shinkou
shinkou

Reputation: 5154

AFAIK, sockets are full duplex, meaning we can read from and write to the same socket at the same time. However, you have to make sure that there's only 1 reader and 1 writer at a time. Please correct me if I was wrong.

Upvotes: 5

Related Questions