ADC Home > Reference Library > Technical Q&As > Networking > Carbon >

Not Recommended Documentclose button

Important: The information in this document is Not Recommended and should not be used for new development.

Current information on this Reference Library topic can be found here:

Synchronous TCP OTConnect Client Call Completes Before Server Responds

Q: I make a synchronous OTConnect call from a TCP client to a TCP server which is passively awaiting an incoming connection. I find that even before the server responds with the OTListen and OTAccept calls, the OTConnect call complete with no error. At this point, if I examine the client endpoint state, I find that it is in the T_DATAXFER state. Can you explain this?

A: As mentioned in the X/Open Transport Interface (XTI) specification, "TCP does not allow the possibility of refusing a connection indication. Each connect indication causes the TCP transport provider to establish the connection. Therefore t_listen() and t_accept() have a symantic which is slightly different from that for ISO providers."

As a result, the server will accept the TCP connection request if the current number of connections is less than the qlen for the passive endpoint. As per the XTI specification, "when the transport detects a T_LISTEN, TCP has already established the connection." The client, whether in synchronous or asynchronous mode, will receive notice that the connection was established. For synchronous endpoints, TCP completes the 3-way connection handshake. For asynchronous endpoints, the OTRcvConnect call must be made to complete the handshake.

[May 14 1996]

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.