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

NetServices.Instance.OnAccept(this.Id, channel.Id, channel.RemoteAddress); #422

Open
tenbit opened this issue Feb 3, 2023 · 1 comment

Comments

@tenbit
Copy link
Contributor

tenbit commented Feb 3, 2023

WService.cs代码中如下代码片段

HttpListenerContext httpListenerContext = await this.httpListener.GetContextAsync();

HttpListenerWebSocketContext webSocketContext = await httpListenerContext.AcceptWebSocketAsync(null);

WChannel channel = new WChannel(this.GetId, webSocketContext, this);

this.channels[channel.Id] = channel;

NetServices.Instance.OnAccept(this.Id, channel.Id, channel.RemoteAddress);

其中NetServices.Instance.OnAccept(this.Id, channel.Id, channel.RemoteAddress);
这行的channel.RemoteAddress是没有值的,应该改为
httpListenerContext.Request.RemoteEndPoint

@egametang
Copy link
Owner

好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants