linux - client connect()先于server accept()成功,client如何知道server accept()成功呢?

标签 linux sockets network-programming tcp

如果客户端connect()先于服务端accept()成功,那么客户端如何知道服务端accept()成功呢? 如果在 connect() 成功和服务器 accept() 之间的时间间隔调用 send() 会发生什么情况,会出现错误吗?

最佳答案

If client connect() succeeds before the server accept(), how does the client know that server accept() is successful?

通过发送请求并成功获得响应。

What happens if send() is called during the time gap between connect() succeeds and server accept(), will there be an error?

没有。数据将进入服务器的套接字接收缓冲区。

关于linux - client connect()先于server accept()成功,client如何知道server accept()成功呢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24727828/

相关文章:

ruby - Ruby可以在Linux ALSA系统中录制PCM麦克风输入吗?

linux - 我遇到 mongo db 停止响应的问题

使用 PyCharm 在远程服务器上进行 Python 绘图

c++ - 如何让每个子进程获得不同的客户端地址(UDP SOCKET)?

.net - Azure Functions 在函数内调用 http post

c++ - 如何跟踪任何程序试图使用哪些网络端口?

php - Raspbian owncloud nginx [错误] 2667#0 : *4 connect() failed (111: Connection refused) while connecting to upstream

c - 打开名称为 socket :[4023] 的套接字

mysql - UFW 3306 端口转发在 RaspberryPi 2 上不起作用

network-programming - Linux 上 C 语言的默认网关