tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Herendi Kristóf Pál <>
Subject A Tomcat 6 Socket Server
Date Sat, 18 Jun 2011 19:30:36 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

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 communication.

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.

View this message in context:
Sent from the Tomcat - Dev mailing list archive at

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

View raw message