Important: The information in this document is obsolete and should not be used for new development.
Event Codes
Your application can include a notifier function that the provider calls to inform you that some provider event has occurred. The provider passes an event code for the function'scodeparameter. The event code specifies which provider event has occurred. The provider can also pass information using theresultandcookieparameters to the notifier function. Normally, if the provider calls your notifier because an asynchronous function has completed, theresultparameter contains the result code for the function and thecookieparameter contains additional information whose meaning varies with the function called. For example, if you call theOTAsyncOpenEndpointfunction, thecookieparameter would contain the endpoint reference for the endpoint provider you just opened.Most of the codes specified by the event codes enumeration are used by endpoint providers and relate to the use of endpoint functions. See "Handling Events for Endpoints" for more information.
The constant names that the provider can use for the event code are given by the following enumeration:
enum { T_LISTEN = (OTEventCode)0x0001, T_CONNECT = (OTEventCode)0x0002, T_DATA = (OTEventCode)0x0004, T_EXDATA = (OTEventCode)0x0008, T_DISCONNECT = (OTEventCode)0x0010, T_ERROR = (OTEventCode)0x0020, T_UDERR = (OTEventCode)0x0040, T_ORDREL = (OTEventCode)0x0080, T_GODATA = (OTEventCode)0x0100, T_GOEXDATA = (OTEventCode)0x0200, T_REQUEST = (OTEventCode)0x0400, T_REPLY = (OTEventCode)0x0800, T_PASSCON = (OTEventCode)0x1000, T_RESET = (OTEventCode)0x2000, T_BINDCOMPLETE = (OTEventCode)0x20000001, T_UNBINDCOMPLETE = (OTEventCode)0x20000002, T_ACCEPTCOMPLETE = (OTEventCode)0x20000003, T_REPLYCOMPLETE = (OTEventCode)0x20000004, T_DISCONNECTCOMPLETE = (OTEventCode)0x20000005, T_OPTMGMTCOMPLETE = (OTEventCode)0x20000006, T_OPENCOMPLETE = (OTEventCode)0x20000007, T_GETPROTADDRCOMPLETE = (OTEventCode)0x20000008, T_RESOLVEADDRCOMPLETE = (OTEventCode)0x20000009, T_GETINFOCOMPLETE = (OTEventCode)0x2000000A, T_SYNCCOMPLETE = (OTEventCode)0x2000000B, T_MEMORYRELEASED = (OTEventCode)0x2000000C, T_REGNAMECOMPLETE = (OTEventCode)0x2000000D, T_DELNAMECOMPLETE = (OTEventCode)0x2000000E, T_LKUPNAMECOMPLETE = (OTEventCode)0x2000000F, T_LKUPNAMERESULT = (OTEventCode)0x20000010, kOTProviderIsDisconnected = (OTEventCode)0x23000001, kOTSyncIdleEvent kOTProviderIsReconnected = (OTEventCode)0x23000002. kOTProviderWillClose = (OTEventCode)0x24000001, kOTProviderIsClosed = (OTEventCode)0x24000002, };Constant descriptions
T_LISTEN- A connection request has arrived. Call the
OTListenfunction to read the request.T_CONNECT- The passive peer has accepted a connection that you requested using the
OTConnectfunction. Call theOTRcvConnectfunction to retrieve any data or option information that the passive peer has specified when accepting the connection or to retrieve the address to which you are actually connected. Thecookieparameter to the notifier function is thesndCallparameter that you specified when calling theOTConnectfunction.T_DATA- Normal data has arrived. Depending on the type of service of the endpoint you are using, you can call the
OTRcvUDatafunction or theOTRcvfunction to read it. Continue reading data until the function returns with thekOTNoDataErrresult; you will not get another indication that data has arrived until you have read all the data and got this error.T_ERROR- Obsolete.
T_EXDATA- Expedited data has arrived. Use the
OTRcvfunction to read it. Continue reading data by calling theOTRcvfunction until the function returns with thekOTNoDataErrresult; you will not get another indication that data has arrived until you have read all the data and got this error.T_DISCONNECT- A connection has been torn down or rejected. Use the
OTRcvDisconnectfunction to clear the event.- If the event is used to signify that a connection has been terminated, the
cookieparameter to the notifier isNULL.- If the event indicates a rejected connection request, the
cookieparameter to the notification routine is the same as thesndCallparameter that you passed to theOTConnectfunction.T_UDERR- The provider was not able to send the data you specified using the
OTSndUDatafunction even though the function returned successfully. You must call theOTRcvUDErrfunction to clear this event and determine why the function failed.T_ORDREL- The remote client has called the
OTSndOrderlyDisconnectfunction to initiate an orderly disconnect. You must call theOTRcvOrderlyDisconnectfunction to acknowledge receiving the event.T_GODATA- Flow-control restrictions have been lifted. You can now send normal data.
T_GOEXDATA- Flow-control restrictions have been lifted. You can now send expedited data
.T_REQUEST- A request has arrived. Depending on the type of service for the endpoint you are using, you can call the
OTRcvRequestfunction or theOTRcvURequestfunction to receive it. You must continue to call the function until it returns with thekOTNoDataErrresult.T_REPLY- A response to a request has arrived. Depending on the type of service of the endpoint you are using, you can call the
OTRcvReplyfunction orOTRcvUReplyfunction to receive it. You must continue to call the function until it returns with thekOTNoDataErrresult.T_PASSCON- When the
OTAcceptfunction completes, the endpoint provider passes this event to the endpoint receiving the connection (whether that endpoint is the same as or different from the endpoint that calls theOTAcceptfunction). Thecookieparameter contains theresRefparameter to theOTAcceptfunction.T_RESET- A connection-oriented endpoint has received a reset from the remote end and has flushed all unread and unsent data. This only occurs for some types of endpoints, and it generally leaves the endpoint in an unknown state.
T_BINDCOMPLETE- The
OTBindfunction has completed. Thecookieparameter contains theretAddrparameter of the bind call.T_UNBINDCOMPLETE- The
OTUnbindfunction has completed. Thecookieparameter is meaningless.T_ACCEPTCOMPLETE- The
OTAcceptfunction has completed. Thecookieparameter contains theresRefparameter to theOTAcceptfunction.T_REPLYCOMPLETE- The
OTSndUReplyorOTSndReplyfunctions have completed. Thecookieparameter contains the sequence number used in theOTSndUReplyorOTSndReplycall.T_DISCONNECTCOMPLETE- The
OTSndDisconnectfunction has completed. Thecookieparameter contains the call parameter of theOTSndDisconnectfunction.T_OPTMGMTCOMPLETE- The
OTOptionManagementfunction has completed. Thecookieparameter contains theretparameter that you passed to the function.T_OPENCOMPLETE- An asynchronous call to open a provider has completed. The
cookieparameter contains the provider reference.T_GETPROTADDRCOMPLETE- The
OTGetProtAddressfunction has completed. Thecookieparameter contains thepeerAddrparameter that you passed to theOTGetProtocolAddressfunction. If you passedNULLfor that parameter, the cookie parameter contains the address passed in theboundAddrparameter.T_RESOLVEADDRCOMPLETE- The
OTResolveAddressfunction has completed. The cookie parameter contains theretAddrparameter of theOTResolveAddressfunction.T_GETINFOCOMPLETE- The
OTGetEndpointInfofunction has completed. Thecookieparameter contains theinfoparameter of theOTGetEndpointInfofunction.T_SYNCCOMPLETE- The
OTSyncfunction has completed. Thecookieparameter is meaningless.T_MEMORYRELEASED- You are using an asynchronous endpoint that acknowledges sends and Open Transport is done using the buffers containing the data you are sending. If you called the
OTSndfunction, thecookieparameter contains thebufparameter. If you called theOTSndUDatafunction, thecookieparameter contains theudataparameter. Theresultparameter contains the number of bytes that were sent. This might be less than the number you meant to send due to flow-control or memory restrictions.- You should not wait for the
T_MEMORYRELEASEDevent from a previous send operation to trigger more sends. The exact time this event occurs depends on how the underlying provider is implemented. It might hold on to memory until the next send occurs, or behave in some other way which causes it to delay releasing memory.- Note that
T_MEMORYRELEASEDevents can reenter your notifier. See "OTAckSends" for more information.T_REGNAMECOMPLETE- The
OTRegisterNamefunction has completed. Thecookieparameter is thereplyparameter, unless it wasNULL. In this case, it is thereqparameter.T_DELNAMECOMPLETE- The
OTDeleteNamefunction or theOTDeleteNameByIDfunction has completed. Thecookieparameter contains thenameparameter or thenameIdparameter of the function, respectively.T_LKUPNAMECOMPLETE- The
OTLookupNamefunction has completed. Thecookieparameter contains thereplyparameter of theOTLookUpNamefunction.T_LKUPNAMERESULT- An
OTLookupNamefunction has found a name and is returning it, but the lookup is not yet complete. Thecookieparameter contains thereplyparameter passed to theOTLookupNamefunction.kOTSyncIdleEvent- A synchronous call is waiting to complete. Call the function
YieldToAnyThreadfrom your notifier to allow other concurrent processes to obtain processing time. See "Using Synchronous Processing With Threads" for more information.kOTProviderIsDisconnected- Your provider was bound with a
qlenparameter value greater than 0 and it has been disconnected (is no longer listening). You receive this event after a port has accepted a request to temporarily yield ownership of a port to another provider, which causes this provider to be disconnected from the port in question. This currently only happens with serial ports, but could also happen with other connection-oriented drivers that have characteristics similar to serial ports. You get akOTProviderIsReconnectedmessage when the port reverts back to this provider's ownership again.kOTProviderIsReconnected- Your provider has been reconnected, that is, the cause for its disconnection has been relieved.
kOTProviderWillClose- When you return from the notifier function, Open Transport will close the provider whose reference is contained in the
cookieparameter. Theresultparameter contains a result code specifying the reason why the provider had to close. For example, the user decided to switch links using the TCP/IP or AppleTalk control panel. The result codes that can be returned are in the range -3280 through -3285; these are documented in "Result Codes".- You can only get this event at system task time. Consequently, you are allowed to set the endpoint to synchronous mode (from within the notifier function) and call functions synchronously before you return from the notifier, at which point the provider is closed. After this, any calls other than
OTCloseProviderwill fail with akOTOutStateErr.kOTProviderIsClosed- The provider has closed. The reason for being closed can be found in the
OTResultvalue passed to your notifier. The reasons typically arekOTPortHasDiedErr,kOTPortWasEjectedErr, orkOTPortLostConnectionErr. At this point, any calls other thanOTCloseProviderwill fail with akOTOutStateErr.