Back: Sockets.ReadBuffer-buffer handling Up: Sockets package Forward: Sockets.ServerSocket class-accessing   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

6.18 Sockets.ServerSocket

Defined in namespace Sockets
Superclass: Sockets.AbstractSocket
Category: Sockets-Streams

This class models server side sockets. The basic model is that the server socket is created and bound to some well known port. It then listens for and accepts connections. At that point the client and server sockets are ready to communicate with one another utilizing whatever application layer protocol they desire.

As with the other AbstractSocket subclasses, most instance methods of this class simply redirect their calls to an implementation class.

6.18.1 Sockets.ServerSocket class: accessing  (class)
6.18.2 Sockets.ServerSocket class: instance creation  (class)
6.18.3 Sockets.ServerSocket: accessing  (instance)
6.18.4 Sockets.ServerSocket: initializing  (instance)


6.18.1 Sockets.ServerSocket class: accessing

defaultImplementationClassFor: aSocketAddressClass
Answer the default implementation class.


6.18.2 Sockets.ServerSocket class: instance creation

defaultQueueSize
Answer the default length of the queue for pending connections. When the queue fills, new clients attempting to connect fail until the server has sent #accept to accept a connection from the queue.

port: anInteger
Answer a new ServerSocket serving on any local address, on the given port, with a pending connections queue of the default length.

port: anInteger bindTo: ipAddress
Answer a new ServerSocket serving on the given address and port, with a pending connections queue of the default length.

port: anInteger queueSize: backlog
Answer a new ServerSocket serving on any local address, on the given port, with a pending connections queue of the given length.

port: anInteger queueSize: backlog bindTo: ipAddress
Answer a new ServerSocket serving on the given address and port, and with a pending connections queue of the given length.

queueSize: backlog
Answer a new ServerSocket serving on any local address and port, with a pending connections queue of the given length.

queueSize: backlog bindTo: ipAddress
Answer a new ServerSocket serving on the given local address, and on any port, with a pending connections queue of the given length.


6.18.3 Sockets.ServerSocket: accessing

accept
Accept a new connection and create a new instance of Socket if there is one, else answer nil.

accept: socketClass
Accept a new connection and create a new instance of socketClass if there is one, else answer nil. This is usually needed only to create DatagramSockets.

address
Answer the local address

port
Answer the local port (the port that the passive socket is listening on).

primAccept: socketClass
Accept a new connection and create a new instance of Socket if there is one, else fail.

waitForConnection
Wait for a connection to be available, and suspend the currently executing process in the meanwhile.


6.18.4 Sockets.ServerSocket: initializing

port: anInteger queueSize: backlog bindTo: localAddr
Initialize the ServerSocket so that it serves on the given address and port, and has a pending connections queue of the given length.



Back: Sockets.ServerSocket-accessing Up: Sockets.ServerSocket Forward: Sockets.Socket   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on July, 23 2009 using texi2html