Is it possible to keep sockets open infinite time

前端 未结 3 1672
心在旅途
心在旅途 2021-01-25 15:39

I\'m new to network programming. I\'m interested is it possible to establish network connection via sockets between Java server and C client and keep the connection open infinit

3条回答
  •  情歌与酒
    2021-01-25 16:14

    This is more a plea than an answer, but as a user I've found sockets drop all the time. You can't keep them open indefintely. When a socket closes unexpectedly, please (A) let the user know the connection has been dropped and (B) make it real easy to reestablish the same connection. Okay, this involved games, but I've had clients that wouldn't admit the server was gone and servers that wouldn't recognise I was the same person as the one with the dropped connection.

提交回复
热议问题