Oberon || Library || Module Index || Search Engine || Definition || Module
TYPE Socket = POINTER TO SocketRec; TYPE SocketRec = RECORD (UnixSockets.SocketRec) END;
PROCEDURE Open(VAR s: Streams.Stream; pathname: ARRAY OF CHAR; bufmode: Streams.BufMode; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE CreateOpenCondition(VAR condition: Conditions.Condition; pathname: ARRAY OF CHAR); PROCEDURE TestAndOpen(VAR s: Streams.Stream; condition: Conditions.Condition; bufmode: Streams.BufMode; errors: RelatedEvents.Object) : BOOLEAN;
PROCEDURE CreateSomeSocket(VAR socket: Socket; VAR pathname: ARRAY OF CHAR; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE Listen(VAR socket: Socket; pathname: ARRAY OF CHAR; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE Remove(socket: Socket) : BOOLEAN;
PROCEDURE Accept(socket: Socket; VAR s: Streams.Stream; bufmode: Streams.BufMode) : BOOLEAN; PROCEDURE CreateAcceptCondition(VAR condition: Conditions.Condition; socket: Socket);
PROCEDURE CreateAddress(VAR address: Networks.Address; path: ARRAY OF CHAR); PROCEDURE ConvertAddress(address: Networks.Address; VAR path: ARRAY OF CHAR); PROCEDURE SetAddress(address: Networks.Address; path: ARRAY OF CHAR);
Open tries to connect to an already created socket which is associated to pathname. CreateOpenCondition and TestAndOpen my be used like their counterparts of Networks for non-blocking openings.
Listen creates a socket which may be later used to wait for incoming connections. Listen creates pathname as a special entry in the file system of type SysStat.socket. CreateSomeSocket works like Listen but selects an unique pathname (which is returned by UnixTmpNames).
Remove removes the pathname which is associated with socket. UnixDomainSockets removes all sockets on termination (see Process).
Accept waits for incoming connections for socket. The socket must have been created and prepared by Listen or CreateSomeSocket. The resulting stream s is connected with the new communication partner.
AcceptCondition creates a condition which evaluates to TRUE if a subsequent Accept would not block for socket.
UnixDomainSockets supports the interface of Networks: CreateAddress takes a path name and converts it into a newly created general network address. ConvertAddress allows the reverse conversion but requires address to be returned earlier by CreateAddress. SetAddress allows to change a network address. Again, address must originate from UnixDomainSockets. General network addresses are persistent objects which allow the interface of Networks to be used which is independent from a particular network implementation.
Errors are converted into events of RelatedEvents. Accept relates its errors to socket. By default, these events are being queued.
Passing an invalid general network address (i.e. an address which does not originate from UnixDomainSockets) to ConvertAddress or SetAddress causes a type guard to fail.
Oberon || Library || Module Index || Search Engine || Definition || Module