}
public void testSocketConnect() throws Exception
{
log.debug("+++ testSocketConnect()");
IOSession bean = getIOSession();
final ServerSocket tmp = new ServerSocket(0);
log.debug("Created ServerSocket: "+tmp);
Thread t = new Thread("Acceptor")
{
public void run()
{
try
{
Socket s = tmp.accept();
log.debug("Accepted Socket: "+s);
s.close();
log.debug("ServerSocket thread exiting");
}
catch(IOException e)
{
}
}
};
int port = tmp.getLocalPort();
t.start();
bean.connect("localhost", port);
tmp.close();
bean.remove();
}