Legacy Documentclose button

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

Previous Book Contents Book Index Next

Inside Macintosh: Networking /
Chapter 7 - Datagram Delivery Protocol (DDP) / DDP Reference
Routines / Opening and Closing DDP Sockets


PCloseSkt

The PCloseSkt function removes the entry for a specific socket from the socket table.

FUNCTION PCloseSkt (thePBptr: MPPPBPtr; async: Boolean): OSErr;
thePBptr
A pointer to an MPP parameter block.
async
A Boolean that specifies whether or not the function should be executed asynchronously. Specify TRUE for asynchronous execution.
-->ioCompletionProcPtrA completion routine.
<--ioResultOSErrThe result code.
-->csCodeIntegerAlways closeSkt for this function.
-->socketByteThe number of the socket to close.

Field Description
socket
The number of the socket you wish to close. You cannot use 0 for this field.
DESCRIPTION
Use the PCloseSkt function to close a socket that you opened with the POpenSkt function. The PCloseSkt function returns a result code of ddpSktErr if you specify a socket number of 0 or if there is no open socket with the socket number you specify.

The PCloseSkt function is equivalent to calling the PBControl function with a value of closeSkt in the csCode field of the parameter block.

ASSEMBLY-LANGUAGE INFORMATION
To execute the PCloseSkt function from assembly language, call the _Control trap macro with a value of closeSkt in the csCode field of the parameter block. You must also specify the .MPP driver reference number. To execute the _Control trap asynchronously, include the value ,ASYNC in the operand field.

RESULT CODES
noErr0No error
ddpSktErr-91Bad socket number
SEE ALSO
For information on the assignment of socket numbers, see "POpenSkt" beginning on page 7-38.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996