mk_1972
mk_1972

Reputation: 11

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

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?

Upvotes: 0

Views: 1036

Answers (1)

user207421
user207421

Reputation: 310840

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

By sending a request and succeeding in getting a response.

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

No. The data will go into the socket receive buffer at the server.

Upvotes: 1

Related Questions