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

Exposed local end point on KcpClient/Server #52

Merged
Merged
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
3 changes: 3 additions & 0 deletions kcp2k/kcp2k/highlevel/KcpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ public class KcpClient
protected Socket socket;
public EndPoint remoteEndPoint;

// The local end point of the client's socket
public EndPoint LocalEndPoint => socket == null ? null : socket.LocalEndPoint;

// config
protected readonly KcpConfig config;

Expand Down
3 changes: 3 additions & 0 deletions kcp2k/kcp2k/highlevel/KcpServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public class KcpServer
protected Socket socket;
EndPoint newClientEP;

// The local end point of the server's socket.
public EndPoint LocalEndPoint => socket == null ? null : socket.LocalEndPoint;

// raw receive buffer always needs to be of 'MTU' size, even if
// MaxMessageSize is larger. kcp always sends in MTU segments and having
// a buffer smaller than MTU would silently drop excess data.
Expand Down