How can I refuse a socket connection in C?

后端 未结 5 511
感情败类
感情败类 2021-01-01 14:03

If I want to accept a connection I call accept, but how can I refuse a connection?

In a working socket echo client I have this if statement. In the echo

5条回答
  •  别那么骄傲
    2021-01-01 14:10

    It might be helpful

    1. to close the listening server socket after having successfully accept()ing the client connection and
    2. to re-establish it after the client connection has gone due to whatever reason.

提交回复
热议问题