#import <ObjectiveLib/Socket.h>
Inheritance diagram for OLServerSocket:
Public Member Functions | |
(OLSocket *) | - acceptConnection |
Accept a connection. | |
(void) | - bindToAddress: |
Bind the socket to a local address. | |
(unsigned) | - queueLength |
Return the queue length. | |
Initializers and Deallocators | |
(id) | - init |
Initialize the socket. | |
(id) | - initWithLocalAddress: |
Initialize the socket. | |
(id) | - initWithLocalAddress:queueLength: |
Initialize the socket. | |
(id) | - initWithQueueLength: |
Initialize the socket. | |
Protected Attributes | |
unsigned | queueLength |
The number of clients that can be made to wait at any given time. |
A server socket typically binds itself to a local address, and then waits for connections to come in via acceptConnection (OLServerSocket). When a connection is received a new socket is returned that can be used to communicate with the client, while the server typically returns to waiting for connections by calling acceptConnection (OLServerSocket) again. This model of usage usually occurs in a multithreaded or multiprocess environment.
- (OLSocket*) acceptConnection |
Accept a connection.
This method will block until a connection is received. The returned socket can be used to communicate with the client that has initiated the connection.
OLSocketException | if there is a problem attempting to accept a connection |
- (void) bindToAddress: | (OLSocketAddress *) | address |
Bind the socket to a local address.
After successfully sending this message the socket will be assigned the local address.
OLSocketException | if there is a problem binding the socket |
address | the address that should be assigned to the socket |
Reimplemented from OLBindableSocket.
Reimplemented in OLUnixServerSocket.
- (id) init |
Initialize the socket.
The socket remains unbound to a local address and has a queue length of 50.
OLSocketException | if the socket cannot be initialized |
- (id) initWithLocalAddress: | (OLSocketAddress *) | address |
Initialize the socket.
The socket is bound to address and has a queue length of 50.
OLSocketException | if the socket cannot be initialized |
address | the local address to which this socket should be bound |
- (id) initWithLocalAddress: | (OLSocketAddress *) | address | ||
queueLength: | (unsigned) | qLen | ||
Initialize the socket.
The socket is bound to address and has a queue length of qLen.
OLSocketException | if the socket cannot be initialized |
address | the local address to which this socket should be bound | |
qLen | the length of the server's queue |
- (id) initWithQueueLength: | (unsigned) | qLen |
Initialize the socket.
The socket remains unbound to a local address and has a queue length of qLen.
OLSocketException | if the socket cannot be initialized |
qLen | the length of the server's queue |
- (unsigned) queueLength |
Return the queue length.
The queue length represents the number of clients that can wait at any given time for a server to accept a connection to them.
- (unsigned) queueLength [protected] |
The number of clients that can be made to wait at any given time.
|