远程处理和套接字有此断开/重新连接问题

时间:2021-07-11 12:15:53

Why doesn't sockets/remoting have the ability to work smoothly when disconnected and reconnected repeatedly? I'm forced to kill both the server and client application and reopen them again.

为什么插座/远程连接在重复断开连接和重新连接时无法顺利工作?我*杀死服务器和客户端应用程序并再次重新打开它们。

What is the fix for this issue?

这个问题的解决方法是什么?

Thanks

Edit: There's no one problem with this issue. Different errors come up...Sometimes,the application crashes and sometimes does does not respond

编辑:此问题没有任何问题。出现了不同的错误......有时,应用程序崩溃,有时确实没有响应

1 个解决方案

#1


The OS will hold socket references for a defined time period to handle any messages remaining on the network/sent from clients. To rebind to a particular port number after shutdown you should have a look at specifying the SO_REUSEADDR option when defining your sockets.

操作系统将在指定的时间段内保存套接字引用,以处理网络上剩余的/从客户端发送的任何消息。要在关闭后重新绑定到特定端口号,您应该在定义套接字时查看指定SO_REUSEADDR选项。

#1


The OS will hold socket references for a defined time period to handle any messages remaining on the network/sent from clients. To rebind to a particular port number after shutdown you should have a look at specifying the SO_REUSEADDR option when defining your sockets.

操作系统将在指定的时间段内保存套接字引用,以处理网络上剩余的/从客户端发送的任何消息。要在关闭后重新绑定到特定端口号,您应该在定义套接字时查看指定SO_REUSEADDR选项。