nos.send();
return;
}
IOControl ioctrl;
ReliableConnectionContext ctx;
if (key == -1) {
OpenConnectionNot ocn = new OpenConnectionNot(true, heartBeat);
ocn.invoke(proxyId);
StreamUtil.writeTo(0, nos);
ctx = (ReliableConnectionContext) ocn.getConnectionContext();
key = ctx.getKey();
StreamUtil.writeTo(key, nos);
nos.send();
ioctrl = new IOControl(sock);
} else {
GetConnectionNot gcn = new GetConnectionNot(key);
try {
gcn.invoke(proxyId);
} catch (Exception exc) {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, "", exc);
StreamUtil.writeTo(1, nos);
StreamUtil.writeTo(exc.getMessage(), nos);
nos.send();
return;
}
ctx = (ReliableConnectionContext) gcn.getConnectionContext();
StreamUtil.writeTo(0, nos);
nos.send();
ioctrl = new IOControl(sock, ctx.getInputCounter());
TcpConnection tcpConnection = proxyService.getConnection(proxyId, key);
if (tcpConnection != null) {
tcpConnection.close();
}