Data loss with TCP sockets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Benny,

I am using stateful_proxy under Linux Debian which works very fine. But sometimes on high data traffic I am wondering about having
data loss when using TCP connections. For e.g. when sending many SIP messages one of them is incomplete and the next one is attached
to this incomplete packet which results to invalid message. 

The reason is on send- function in pj_sock_send(): On high traffic sometimes it returns EAGAIN / EWOULDBLOCK. In this case pjsip
tries to send the packet asynchronously and everything is fine. But sometimes send() can only send a packet fragment and returns the
number of bytes sended (which is then smaller then the packet size). pj_sock_send() returns PJ_SUCCESS because the return value is >
0 but there is no check if the complete packet is sended.

A solution is that pjsip detects if only a packet fragment was sended and tries to send the rest of packet asynchronously.


Best regards,
Helmut





[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux