Unless you are happy ignoring the J2EE specification session beans must not open socket connections.
You should be looking at JCA or possible MBeans to handle the connections.
"An enterprise bean must not attempt to listen on a socket, accept connections on a socket, or use a socket for multicast."
This is what the ejb spec (2.1) says. I do not listen on a socket, nor do I accept connections nor do I use a socket for multicast. I am connecting to a socket (Socket.connect).
Is there a way how the container can provide me with a persistent socket connection to a specific machine on a specific port? Or do I have to write and configure my own resource adapter to handle these connections properly?