DDPWrite
DDPWrite
Send a datagram to another socket ATDDPRecHandle abRecord; handle to an ATDDPRec Boolean doChecksum; 0=FALSE; 1=TRUE Boolean aync; 0=await completion; 1=immediate return DDPWrite is part of the AppleTalk alternate interface. It is recommended that you use the preferred call, PWriteDDP instead. DDPWrite sends a datagram to another socket. abRecord is a handle to an ATDDPRec structure. The relevant fields are as follows:
¨ abResult short 2 2 Result code
Æ abUserReference long 4 4 For your use
Æ ddpType short 2 DDP protocol type Æ ddpSocket short 2 10 Source socket number
Æ ddpAddress AddrBlock 4 12 Destination socket address Æ ddpReqCount short 2 16 Length of datagram data
Æ ddpDataPtr Ptr 4 20 Pointer to buffer checksum; if FALSE, this software checksum feature is ignored.
async is a Boolean value. Use FALSE for normal ( synchronous) operation or TRUE to enqueue the request and resume control immediately. See Async I/O.
noErr (0) No error
ddpSktErr (-91) Source socket not open
ddpLenErr (-92) Datagram length too big
noBridgeErr (-93) No bridge found.
Notes: DDPWrite sends a datagram to another socket. ddpReqCount and ddpDataPtr specify the length and location of the data to send. The ddpType
field indicates the DDP protocol type of the frame, and ddpAddress is the
complete internet address of the socket to which the datagram should be
sent. DDPSocket specifies the socket from which the datagram should be
sent. Datagrams sent over the internet to a node on an AppleTalk network
different from the sending node's network have an optional software
checksum to detect errors that might occur inside the intermediate bridges.
If doChecksum is TRUE DDPWrite will compute this checksum; if it's FALSE, this software checksum feature is ignored.
Upon opening, the ability to send a packet to one's own node (intranode
delivery) is disabled. This feature of the AppleTalk Manager can be manipulated through the SetSelfSend function. Once enabled it is possible,
at all levels, to send packets to entities within one's own node. An example
of where this might be desirable is in an application sending data to a print
spooler that is actually running in the background on the same node.
Enabling or disabling this feature affects the entire node and should be
performed with care. For instance, a desk accessory may not expect to
receive names from within its own node as a response to an NBP look-up;
enabling this feature from an application could break the desk accessory.