c plusplus wrote:
> hi all, I encountered a strange thing when using select() function in
> multithread. Here is what I met: One application use two threads, one
> manages connection with blocking select from sctp (tcp-style ), other
> manages connection with blocking select from TCP. And the application
> will deal with the message and then send it from one to other,vice
> versa. But under the situation about two messages per second one
> direction(total 4 or 5 messages both directions), the application work
> well. And when up to 5 messages persecond one direction, the select at
> TCP side can not report any message reached any more. But I can see the
> message has been sent to the TCP connection from ethereal.
> Now, what confuse me is whether one thread with one select can cause
> conflict when message came in. (one select on tcp side can't work,
> other work well)And what real reasons do cause this problem?
> Any hints are appceciated. Thank you in advance.
>
> ps: linux kernel : 2.6.17-4
Sounds like you either have a bug or you think that TCP somehow glues
bytes together into messages. You understand that a select hit on a TCP
connection has nothing whatsoever to do with any messages, it means
that some *bytes* may be received. TCP does not glue bytes together
into messages.
DS
|