You should hanlde both ports 7001 and 7002 at the same time, as pointed out in the
socket tutorial.
But I paste below the advice I previously gave in this same thread:
Java Adapters usually run in-process with the Lightstreamer Server, so you don't need to use the socket-based protocol. In such case, you will use the provided Java API (as introduced in the
Java tutorial). Only in case you have a requirement to make the Java Adapters run on a different machine than the Lightstreamer Server, you should actually open sockets by hand and implement the Lightstreamer network protocol.