jigar-joshi / libjingle

Automatically exported from code.google.com/p/libjingle
0 stars 0 forks source link

WinSock Recvfrom() now returns WSAECONNRESET instead of blocking or timing out #142

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Libjingle 0.5.2

Refer to:
http://support.microsoft.com/kb/263823/en-us

For Libjingle, I have encountered such issue. If on the same pc, invoking 
SendTo() from one port to another port, the function will return -1 with error 
WSAECONNRESET (10054) Connection reset by peer.

I change the physicalsocketserver.cc as the below:
1.
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
[AddMyChange]
#define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12) 
...

2.
  // Creates the underlying OS socket (same as the "socket" function).
  virtual bool Create(int type) {
    Close();
    s_ = ::socket(AF_INET, type, 0);

[AddMyChange]   
#ifdef WIN32
    DWORD dwBytesReturned = 0;
    BOOL bNewBehavior = FALSE;
    DWORD status;

    // disable  new behavior using
    // IOCTL: SIO_UDP_CONNRESET
    status = WSAIoctl(s_, SIO_UDP_CONNRESET,
                   &bNewBehavior, sizeof(bNewBehavior),
                   NULL, 0, &dwBytesReturned,
                   NULL, NULL);
#endif
...

Please estimate how to fix this issue gracefully and with less side-effect.

Original issue reported on code.google.com by haojies...@gmail.com on 19 Feb 2011 at 4:21

GoogleCodeExporter commented 9 years ago
Hi haojiesong,
I'm studing Libjingle too, the version is 0.5.7.
Do the method you mentioned above work well?
I do the same change in my project, but I also receive the "ortp-warning-Error 
receiving RTCP packet: Connection reset by peer."

Original comment by changliu...@gmail.com on 29 Jul 2011 at 10:17

GoogleCodeExporter commented 9 years ago
I'm using libjingle-0.6.6 with linphonemediaengine enabled, and I also 
encountered this problem. I can send voice to the other side, but I cannot 
hear. Does anyone know what the problem is?

Original comment by tangketa...@gmail.com on 2 Mar 2012 at 3:23