Next: , Previous: , Up: Classes   [Index]


UNIXNetworkStreamWriter

UNIXNetworkStreamWriter Class

UNIXNetworkStreamWriter objects send data over machine- local UNIX domain sockets. The class contains methods to open sockets and send data over the network connection.

For an example of how to use UNIXNetworkStreamWriter objects, refer to the programs in the UNIXNetworkStreamReader section. See UNIXNetworkStreamReader.

Instance Variables

charsWritten

An Integer that contains the number of bytes written by the previous call to the sockWrite method, which is described below.

Instance Methods

open (void)

Creates a machine-local UNIX socket connection with the socket name given by the socketPath instance variable, which is defined in UNIXNetworkStream class. See UNIXNetworkStream.

If successful, the method returns the file handle number of the new socket. If an error occurs, the method returns -1 and raises a SystemErrnoException if the error occured in a library call.

openOn (String socketpath)

Creates a new writer socket and binds it to socketpath. Sets the receiver’s socketPath instance variable to the argument. Returns an Integer with the file number of the newly created socket.

sockWrite (String data)

Writes data to the socket created by a previous call to the open method, above. Sets the receiver’s charsWritten instance variable to the number of characters written. If successful, returns 0, or if an error occured, returns -1 and raises a SystemErrnoException.