BaseConnection con = ccm.lookupConnectionById(cc.id);
private boolean writeEncrypted(boolean didWork, int i, Pipe<NetPayloadSchema> pipe) { long chnl = Pipe.peekLong(pipe, 0xF&NetPayloadSchema.MSG_ENCRYPTED_200_FIELD_CONNECTIONID_201); ClientConnection cc = (ClientConnection)ccm.lookupConnectionById(chnl); if (null==cc) {//closed or we can not get it yet, just push back till later. return false; } final int msgIdx = Pipe.takeMsgIdx(pipe); final long channelId = Pipe.takeLong(pipe); assert(chnl==channelId); final long arrivalTime = Pipe.takeLong(pipe); int meta = Pipe.takeByteArrayMetaData(pipe); //for string and byte array int len = Pipe.takeByteArrayLength(pipe); if (showWrites) { logger.info("/////\n/// has connection "+((cc!=null)&&cc.isValid())+" channelId "+channelId+" write encrypted length:"+len); } didWork = wrapupUpEncryptedToSingleWrite(didWork, i, pipe, msgIdx, channelId, meta, len, cc); return didWork; }
private boolean writePlain(boolean didWork, int i, Pipe<NetPayloadSchema> pipe) { long chnl = Pipe.peekLong(pipe, 0xF&NetPayloadSchema.MSG_PLAIN_210_FIELD_CONNECTIONID_201); ClientConnection cc = (ClientConnection)ccm.lookupConnectionById(chnl); if (null==cc) { return false;
private boolean writeDisconnect(Pipe<NetPayloadSchema> pipe) { long chnl = Pipe.peekLong(pipe, 0xF&NetPayloadSchema.MSG_DISCONNECT_203_FIELD_CONNECTIONID_201); ClientConnection cc = (ClientConnection)ccm.lookupConnectionById(chnl); int msgIdx = Pipe.takeMsgIdx(pipe); long channelId = Pipe.takeLong(pipe); assert(chnl==channelId); if (cc!=null) { if (cc.isValid()) { //only begin disconnect if not already disconnected cc.beginDisconnect();//do not close or we will not get any response } else { //already closed so remove value ccm.removeConnection(channelId); } } else { //already closed so remove value ccm.removeConnection(channelId);//already closed so remove if possible } Pipe.confirmLowLevelRead(pipe, Pipe.sizeOf(pipe, msgIdx)); Pipe.releaseReadLock(pipe); return true; }
ClientConnection clientConnection = (ClientConnection) ccm.lookupConnectionById(connectionId); if (null==clientConnection || (! clientConnection.isFinishConnect())) { break;
ClientConnection cc = (ClientConnection)clientCoord.lookupConnectionById(connectionId);
cc = (HTTPClientConnection)ccm.lookupConnectionById(ccId); if (null==cc) { //skip data the connection was closed
ClientConnection cc = ((ClientConnection)ccm.lookupConnectionById(connectionId)); if (null!=cc) { cc.beginDisconnect();