public class JOrbisSocketServer extends TCPSocketServer
PirateTunesClientThread
) on the server.
It acts as a Network based relay of requests.
It works well with its companion class TCPSocketClient
. DEFAULT_port
44444
.java ca.bc.webarts.tools.sockets.TCPSocketServer [portNumber] - portNumber is optionalIts default function is to take whatever message is sent and execute it directly on the commanline. You should change this to whatever you want.
TCPSocketServer tcpServer = new TCPSocketServer(portToUse); int i = 0; boolean posted = false; while (tcpServer.getSocket()!=null) { try { // Listening for another client connection if (debug_>1) System.out.println("Accepting new connections "); posted = tcpServer.postConnection(tcpServer.getSocket().accept()); //if (debug_>1) System.out.println("connectionPosted> "+posted); if (!posted) { if (debug_>0) System.out.println(" NOT Posted: ClientThreads MAXXED: "); } } catch (IOException e) { System.out.println(e); } }
TCPSocketServer.ClientProcessorThread
Modifier and Type | Field and Description |
---|---|
protected static String |
clientThreadClassname_ |
protected static JOggPlayerListener |
player_ |
acceptingConnections_, clientQueue_, clientSocket_, debug_, DEFAULT_PORT, END, ERROR, MAX_CLIENTS_COUNT, messageEnd_, portNumber_, processor_, serverSocket_, SUCCESS
Constructor and Description |
---|
JOrbisSocketServer()
Default constructor that uses default server and port.
|
JOrbisSocketServer(int portNum)
Constructor that uses sets a specified server and port.
|
Modifier and Type | Method and Description |
---|---|
ClientThread |
getClientThreadInstance()
Gets an instantiated ClientThread connected tothe assigned socket.
|
static void |
main(String[] args) |
static void |
setClientThreadClassname() |
closeUpShop, getClientThreadClassname, getClientThreadInstance, getMessageEnd, getServerSocket, getSocket, initPortProcessors, postConnection, postConnection, setClientThreadClassname, setMessageEnd
protected static String clientThreadClassname_
protected static JOggPlayerListener player_
public JOrbisSocketServer()
public JOrbisSocketServer(int portNum)
public ClientThread getClientThreadInstance()
getClientThreadInstance
in class TCPSocketServer
public static void setClientThreadClassname()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses