Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Found endpoint in unexpected state



At 12:54 -0500 5/6/01, Beat Zenerino wrote:
I have a TCP/IP client that's connected to a server residing on the same
machine. After I send the "OTRcvOrderlyDisconnect" and

Huh? You're "sending" an orderly disconnect using "OTRcvOrderlyDisconnect"?

try to OTUnbind the
client endpoint, I get a -3168. The OTGetEndpointState reports that the
endpoint is in state T_INREL. According to Figure 4-2 on page 93 in
"Networking with Open Transport" the active peer should never be in this
state. I'm guessing that I have to wait until the endpoint is in the T_IDLE
state before trying to unbind and will try that next, but isn't there
something wrong with the chart in the manual.

This figure is slightly misleading in that the "active peer" and "passive peer" labels are not necessarily the same for connection and disconnection. For example, if you have a client that connects to a server, sends some data, waits for some results, and then waits for the server to disconnect (for example, HTTP), the client is the active peer as far as the connection phase is concerned but the passive peer as far as the disconnect is concerned. Does that help clarify things?

btw The one edge case associated with disconnect that IM:NWOT doesn't really cover (primarily because I didn't understand it until recently) is as follows. When you call OTSndOrderlyDisconnect you have to wait until the other end acknowledges the disconnect before calling OTRcvOrderlyDisconnect. The standard way of doing this in XTI (and hence in the sync/block OT API) is to do a one byte receive, which blocks waiting for the other end. You can see this in the OrderlyDisconnect routine in "OTMPSimpleServerHTTP.c" in the OTMP sample code.

S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware


References: 
 >Found endpoint in unexpected state (From: "Beat Zenerino" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.