All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class SE.kth.speech.broker.SocketSender

SE.kth.speech.broker.SocketSender

public abstract class SocketSender

Constructor Index

 o SocketSender()
 o SocketSender(String, int)
Creates a SocketSender which transmits to a ServerSocket.

Method Index

 o getError()
Return an error if one has occurred.
 o getLocalHostName()
Return the name of the host that the client should connect to.
 o getServerPort()
Return the port that the client should connect to.
 o getThread()
Returns the thread which is sending on the socket.
 o run()
Wait for a connection and send the data.
 o setDebug(boolean)

Constructors

 o SocketSender
 public SocketSender() throws IOException
 o SocketSender
 public SocketSender(String host,
                     int port) throws UnknownHostException, IOException
Creates a SocketSender which transmits to a ServerSocket.

Parameters:
hostPort - a string consisting of the hostname, a space, and the port number

Methods

 o setDebug
 public void setDebug(boolean dbg)
 o getServerPort
 public int getServerPort()
Return the port that the client should connect to.

Returns:
The port number, or 0 if a client has already connected (The socket sender will only send data to one client)
 o getLocalHostName
 public String getLocalHostName()
Return the name of the host that the client should connect to.

Returns:
The (local) host name
 o run
 public void run()
Wait for a connection and send the data. The code for the thread which actually waits for a connection, sends the data, and closes the connection

See Also:
run
 o getThread
 public Thread getThread()
Returns the thread which is sending on the socket. This thread will terminate when all the data has been read.

 o getError
 public BrokerException getError()
Return an error if one has occurred.

Returns:
s an error if one has occurred, otherwise null.

All Packages  Class Hierarchy  This Package  Previous  Next  Index