How do I fix the error “Only one usage of each socket address (protocol/network address/port) is normally permitted”?

前端 未结 3 2053
慢半拍i
慢半拍i 2020-12-28 12:40

I\'ve done a lot of googling but not had much luck with my issues. I am new to network programming and trying to learn, I\'ve attempted to set up a simple server & clien

3条回答
  •  轮回少年
    2020-12-28 13:04

    ListenForClients is getting invoked twice (on two different threads) - once from the constructor, once from the explicit method call in Main. When two instances of the TcpListener try to listen on the same port, you get that error.

提交回复
热议问题