Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TCP Fast Open support #1328

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions shadowsocks-csharp/Controller/Service/Listener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public void Start(Configuration config)

// Start an asynchronous socket to listen for connections.
Logging.Info("Shadowsocks started");
Logging.Info($"TFO: {Program.TFOSupported}");
_tcpSocket.BeginAccept(new AsyncCallback(AcceptCallback), _tcpSocket);
UDPState udpState = new UDPState();
udpState.socket = _udpSocket;
Expand Down
4 changes: 2 additions & 2 deletions shadowsocks-csharp/Controller/Service/PortForwarder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private class Handler
private byte[] _firstPacket;
private int _firstPacketLength;
private Socket _local;
private WrappedSocket _remote;
private Socket _remote;
private bool _closed = false;
private bool _localShutdown = false;
private bool _remoteShutdown = false;
Expand All @@ -52,7 +52,7 @@ public void Start(byte[] firstPacket, int length, Socket socket, int targetPort)
EndPoint remoteEP = SocketUtil.GetEndPoint("127.0.0.1", targetPort);

// Connect to the remote endpoint.
_remote = new WrappedSocket();
_remote = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_remote.BeginConnect(remoteEP, ConnectCallback, null);
}
catch (Exception e)
Expand Down
Loading