MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / run

Method run

CodenameOne/src/com/codename1/io/Socket.java:78–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76 }
77 Display.getInstance().startThread(new Runnable() {
78 @Override
79 public void run() {
80 Object connection = Util.getImplementation().connectSocket(host, port, sc.getConnectTimeout());
81 if (connection != null) {
82 sc.setConnected(true);
83 sc.input = new SocketInputStream(connection, sc);
84 sc.output = new SocketOutputStream(connection, sc);
85 sc.connectionEstablished(sc.input, sc.output);
86 } else {
87 sc.setConnected(false);
88 if (connection == null) {
89 sc.connectionError(-1, "Failed to connect");
90 } else {
91 sc.connectionError(Util.getImplementation().getSocketErrorCode(connection), Util.getImplementation().getSocketErrorMessage(connection));
92 }
93 }
94 }
95 }, "Connection to " + host).start();
96 }
97

Callers

nothing calls this directly

Calls 8

getImplementationMethod · 0.95
setConnectedMethod · 0.80
connectSocketMethod · 0.45
getConnectTimeoutMethod · 0.45
connectionEstablishedMethod · 0.45
connectionErrorMethod · 0.45
getSocketErrorCodeMethod · 0.45
getSocketErrorMessageMethod · 0.45

Tested by

no test coverage detected