Oberon || Library || Module Index || Search Engine || Definition || Module
TYPE Socket = UnixSockets.Socket; TYPE Address = IPv4Addresses.Address; TYPE SocketAddress = IPv4Addresses.SocketAddress;
PROCEDURE Open(VAR s: Streams.Stream; address: SocketAddress; bufmode: Streams.BufMode; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE OpenAs(VAR s: Streams.Stream; address, bindto: SocketAddress; bufmode: Streams.BufMode; errors: RelatedEvents.Object) : BOOLEAN;
PROCEDURE CreateOpenCondition(VAR condition: Conditions.Condition; address: SocketAddress); PROCEDURE CreateOpenConditionAs(VAR condition: Conditions.Condition; address, bindto: SocketAddress); PROCEDURE TestAndOpen(VAR s: Streams.Stream; condition: Conditions.Condition; bufmode: Streams.BufMode; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE Drop(condition: Conditions.Condition);
PROCEDURE CreateSomeSocket(VAR socket: Socket; VAR address: SocketAddress; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE CreateSomeSocketOn(VAR socket: Socket; VAR address: SocketAddress; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE Listen(VAR socket: Socket; portnum: INTEGER; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE ListenOn(VAR socket: Socket; address: SocketAddress; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE Accept(socket: Socket; VAR s: Streams.Stream; bufmode: Streams.BufMode; VAR peer: SocketAddress) : BOOLEAN; PROCEDURE Release(socket: Socket);
PROCEDURE CreateAcceptCondition(VAR condition: Conditions.Condition; socket: Socket);
PROCEDURE GetName(socket: Socket; VAR address: SocketAddress; errors: RelatedEvents.Object) : BOOLEAN;
Open tries to create a socket which is connected to the given IPv4 address. IPv4 addresses consist of a 4-byte address which identifies the host and a 2-byte integer which identifies the communication partner on that machine.
OpenAs works like Open but allows in bindto a local IP address to be specified the socket is to be bound to locally. This is useful in case of virtual IP addresses.
CreateOpenCondition and TestAndOpen may be used like their counterparts of Networks for non-blocking openings. CreateOpenConditionAs works like CreateOpenCondition but allows in bindto a local IP address to be specified (see OpenAs). Drop may be used to get rid of conditions created by CreateOpenCondition or CreateOpenConditionAs which have not yet been successfully opened using TestAndOpen.
Listen creates a socket which may be later used to wait for incoming connections. Each socket is uniquely identified by a port number on the current machine. ListenOn works like Listen but allows a full IPv4 address to specified (mainly for virtual IP addresses).
CreateSomeSocket and CreateSomeSocketOn operate like Listen and ListenOn but leave the selection of the port number up to the system. Note that address is an out-parameter only for CreateSomeSocket while CreateSomeSocketOn honors the host part of address. Release allows to release a socket which has been formerly created by Listen. Accept waits for incoming connections for socket. The socket must have been created and prepared by Listen, ListenOn, CreateSomeSocket, or CreateSomeSocketOn. The resulting stream s is connected with the new communication partner. The address of the other side is stored into peer.
CreateAcceptCondition creates a condition which evaluates to TRUE if a subsequent Accept would not block for socket.
GetName returns the address of a socket. This is particularly useful when a port number of 0 has been given to Listen in order to delegate the choice to the system.
Errors are converted into events of RelatedEvents. Accept relates its errors to socket. By default, these events are being queued.
Oberon || Library || Module Index || Search Engine || Definition || Module