Creating Java Listener on a specific socket

Hi,

I reasonably new to Java, I have only really had experience with JSP pages. Now what I would like to accomplish is to create a listening program that will listen on a port yet to be specified and peform certain tasks on the local database before returning a successful completion message.

Could someone please tell me where I can start to accomplish this? I am running Tomcat on Solaris 7 and I am assuming I will first of all need to open a port to listen, then create a listening program ..... But that is the best I've got ...

thanks in advance.

[585 byte] By [shann0nw] at [2007-9-26 2:35:28]
# 1

Start off by understanding some of the structures in client-server programming. All the classes you need are in java.net. You will want to create a java.net.ServerSocket in the server (or listener) process. You can then connect to this with anything you like (including telnet), but in java, you can use java.net.Socket.

You can find a good introduction to client-server code in Bruce Eckel's Thinking in Java book

http://www.mindview.net/Books/TIJ/

Rob

rob_canoe2 at 2007-6-29 10:01:52 > top of Java-index,Archived Forums,Java Programming...