Browse Source

Merge pull request #2387 from zyc9012/udpfix

Fix udp relay
tags/4.1.7
Allen Zhu GitHub 5 years ago
parent
commit
1b06bab4c4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      shadowsocks-csharp/Controller/Service/UDPRelay.cs

+ 2
- 1
shadowsocks-csharp/Controller/Service/UDPRelay.cs View File

@@ -40,10 +40,10 @@ namespace Shadowsocks.Controller
if (handler == null)
{
handler = new UDPHandler(socket, _controller.GetAServer(IStrategyCallerType.UDP, remoteEndPoint, null/*TODO: fix this*/), remoteEndPoint);
handler.Receive();
_cache.add(remoteEndPoint, handler);
}
handler.Send(firstPacket, length);
handler.Receive();
return true;
}
@@ -74,6 +74,7 @@ namespace Shadowsocks.Controller
}
_remoteEndPoint = new IPEndPoint(ipAddress, server.server_port);
_remote = new Socket(_remoteEndPoint.AddressFamily, SocketType.Dgram, ProtocolType.Udp);
_remote.Bind(new IPEndPoint(IPAddress.Any, 0));
}
public void Send(byte[] data, int length)


Loading…
Cancel
Save