0

I have a little program here where I try to create a server socket on the port 1234.

public class SocketTest {
public static void main(String[] args) {

    try {           
        ServerSocketConnection scn;
        scn = (ServerSocketConnection) Connector.open("socket://:1234");
    } catch (IOException e) {
        e.printStackTrace();
    }

}
}

I get a RuntimeException caused by the Connector.open() method.

UPDATE: Stack trace:

Exception in thread "main" java.lang.RuntimeException
at ej.ecom.io.Connector.open(Connector.java:61)
at SocketTest.main(SocketTest.java:12)

I tried to disable my antivirus and firewall and to put the creation of socket to a separate thread, but nothing changes. I feel I am making a basic mistake here. What am I doing wrong?

Limbo Exile
  • 1,321
  • 2
  • 21
  • 41

0 Answers0