I need to create a socket server to listen to port messages from inside of Glassfish.
If I write something simple like the code below, it freezes Glassfish during the deployment of the app.
What is the safe way to implement this functionality?
@Singleton
@Startup
public class MySocketServer {
ServerSocket serverSocket = null;
@PostConstruct
private void init() {
try {
serverSocket = new ServerSocket(SOCKET_PORT);
} catch (IOException ex) {
System.err.println(ex.getMessage());
}
//...
}
}
[Message sent by forum member 'denisz']
http://forums.java.net/jive/thread.jspa?messageID=472989