java
setSocket(connect(host, 5222));
if (getSocket() == null) {
throw new java.io.IOException(connectError);
}
setConnection(new com.jabberwookie.Client2Server(getSocket()
.openInputStream(), getSocket().openOutputStream()));
if (!getConnection().open(host, 60000)) {
throw new java.io.IOException("Could not establish stream to "
+ host + ":5222 after 60 seconds");
}
java
StreamConnection s = null;
try {
s = (StreamConnection) Connector.open("socket://" + host + ":"
+ port);
} catch (Exception e) {
connectError = e.getMessage() + " at MEJabber.connect(" + host
+ ", " + port + ")";
}
return s;