fr.ove.clientserver
Class SocketServer

java.lang.Object
  extended byfr.ove.clientserver.SocketServer
All Implemented Interfaces:
java.lang.Runnable

public class SocketServer
extends java.lang.Object
implements java.lang.Runnable

A socket server.


Constructor Summary
SocketServer()
          The default constructor.
SocketServer(int portNumber, int maxSocket)
          The constructor.
 
Method Summary
 void addSocketServerListener(SocketServerListener listener)
          Registers a listener to the instance.
 void fireSocketServerEvent(SocketServerEvent evt)
          Fires an event to the registered listeners of the instance.
 void removeSocketServerListener(SocketServerListener listener)
          Removes a registered listener from the instance.
 void run()
          Run the socket server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketServer

public SocketServer()
             throws java.io.IOException
The default constructor.
The default is a socket server running on port 6666 and allowing the creation of a maximum of 300 sockets.


SocketServer

public SocketServer(int portNumber,
                    int maxSocket)
             throws java.io.IOException
The constructor.

Parameters:
portNumber - the port number used on the host to run the socket server.
maxSocket - the maximu number of socket created allowed.
Method Detail

addSocketServerListener

public void addSocketServerListener(SocketServerListener listener)
                             throws java.util.TooManyListenersException
Registers a listener to the instance.

Parameters:
listener - the listener to register.
Throws:
java.util.TooManyListenersException

removeSocketServerListener

public void removeSocketServerListener(SocketServerListener listener)
Removes a registered listener from the instance.

Parameters:
listener - the listener to remove.

fireSocketServerEvent

public void fireSocketServerEvent(SocketServerEvent evt)
Fires an event to the registered listeners of the instance.

Parameters:
evt - the event to fire.

run

public void run()
Run the socket server.

Specified by:
run in interface java.lang.Runnable


Copyright © 1999-2007 Universit?© de Nice Sophia-Antipolis, I3S, Ove SARL, DFKI and Universit?§t des Saarlandes. All Rights Reserved.