fr.ove.clientserver
Class Server

java.lang.Object
  extended byfr.ove.clientserver.Server
All Implemented Interfaces:
java.util.EventListener, SocketServerListener

public class Server
extends java.lang.Object
implements SocketServerListener

A server.
After its instanciation, don't forget to set the connection handler. Otherwise, clients could not connect.


Constructor Summary
Server()
          The default constructor.
Server(int portNumber, int maxConnection)
          The constructor.
 
Method Summary
 ConnectionHandler getConnectionHandler()
          Returns the connection handler of the server.
 void setConnectionHandler(ConnectionHandler handler)
          Sets the connection handler for the server.
 void socketAccepted(SocketServerEvent evt)
          Accept the socket encapsulated inside the event fired by the socket server listenned.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Server

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


Server

public Server(int portNumber,
              int maxConnection)
       throws java.io.IOException
The constructor.

Parameters:
portNumber - the port number used on the host to run the server.
Method Detail

setConnectionHandler

public void setConnectionHandler(ConnectionHandler handler)
Sets the connection handler for the server.

Parameters:
handler - the connection handler.

getConnectionHandler

public ConnectionHandler getConnectionHandler()
Returns the connection handler of the server.


socketAccepted

public void socketAccepted(SocketServerEvent evt)
Accept the socket encapsulated inside the event fired by the socket server listenned.

Specified by:
socketAccepted in interface SocketServerListener
Parameters:
evt - the event fired by the socket server listenned.


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