EWrite
EWrite Send a data packet over Ethernet
#include <ENET.h> AppleTalk Manager
OSErr EWrite( thePBptr, async);
EParamBlkPtr thePBptr; address of an EParamBlock structure
Boolean async; 0=await completion; 1=immediate return
returns Error Code; 0=no error
EWrite uses The .ENET Driver to send a data packet over Ethernet.
thePBptr is a pointer to an EParamBlock structure. The relevant fields are as
follows:
Out-InName Type Size Offset Description
¨ ioResult short 2 16 Result code
Æ csCode short 2 26 Always ENetWrite
Æ ePointer long 4 30 Pointer to write-data structure
async is a Boolean value. Use FALSE for normal ( synchronous) operation
or TRUE to function asynchronously. See Async I/O.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
eLenErr (-92) Packet too large or first entry of the write-data
structure did not contain the full 14-byte header
excessCollsns (-95) Hardware error

Notes: You must first prepare a write-data structure that specifies the
destination address and the protocol type and contains the data that you want
to send. You place a pointer to the write-data structure in the ePointer
parameter. If you want to send a packet larger than 768 bytes, first call
the ESetGeneral function to put The .ENET Driver in
general-transmission mode. If the size of the packet you provide is less than
60 bytes, the driver adds pad bytes to the packet. Write-data structures are
described in Using a Write-Data Structure
The ioResult parameter returns the result of the function. If you call the
function asynchronously, the function sets this field to 1 as soon as it
begins execution, and it changes the field to the actual result code when it
completes execution. The csCode parameter is a routine selector that is set
automatically for you by the high-level language interface; it is always
equal to ENetWrite for this function