开发者

TcpListener invalid argument specified

开发者 https://www.devze.com 2023-04-06 01:43 出处:网络
I\'m not really sure what is wrong because I have tried the other method overload for TcpListener.Start(int backlog) but the same resu开发者_JS百科lt occurred. Maybe it is something wrong with how I

TcpListener invalid argument specified

I'm not really sure what is wrong because I have tried the other method overload for TcpListener.Start(int backlog) but the same resu开发者_JS百科lt occurred. Maybe it is something wrong with how I initialized it?


Why are you specifying a host and port twice? Supplying them to the TcpListener constructor should suffice:

public Station()
{
    this.connections = new List<TcpClient>();
    this.server = new TcpCient(IPAddress.Loopback, 6969);
}

public void Start()
{
    server.Start();
}
0

精彩评论

暂无评论...
验证码 换一张
取 消