Java code to make a port listen