tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject A Tomcat 6 Socket Server
Date Sun, 19 Jun 2011 08:06:55 GMT
To whom is reading this mail.


For some time i have been learning some server technologies for my own  
needs. I have tried PHP but the way its constructed or the way it  
handles scripts for object oriented programing wasn't suitable for me.  
Java is more the way i think of programing and that is why i thought  
to give a try on Tomcat.

I have looked for books. Most or all of them covers only JSP, JSF or  
JDBC but non of them covers TCP - socket communication in details such  
as the ServerSocketFactory, the JSSEFactory or the ThreadPool. I could  
mention some more issues when setting up a socket based application  
like SocketPermision.

I wrote this mail in hope for answers, guidance or best practice for  
writing a Socket based application server for handling ByteArray  

Where can i get the knowlage? How can i get smarter?

Thank you in advence,
Herendi Kristóf Pál
Budapest, Hungary - 2011 June the 11th.


To give you some idea of what i was try to accomplish, here is a  
pseudo code for a Java Socket Server:

package Server;


public class ServerMain {
     private NewConnections newConn;
     private LogedInUsers ConnMemb;
     private UserList userList;
     private CommunicationGroups ComGroups;

     public ServerMain(){
         userList = new UserList();
         ConnMemb = new LogedInUsers();
         newConn = new NewConnections();
         ComGroups = new CommunicationGroups();

             ServerSocket serevrSock = new ServerSocket(4444);
             Socket clientSocket;
             System.out.println("Server ready, waiting for a client...");
             clientSocket = serevrSock.accept();
             new ConnectionHandler(clientSocket, userList, newConn,  
ConnMemb, ComGroups).start(); // extends Thread
         }catch(Exception e){
             System.out.println("Server startUp error: "+e);
     public static void main(String args[]){
         new ServerMain();

// ### END

Its simple.
I have spent some time to try to translate it for Tomcat but with out  
any refference i couldnt find the way to make it work.

If you would like to see the Tomcat version i would be happy to post  
it, but before i would like to see an experts "best practice", if i  
can have :)

   Externet Webmail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message