protected void socketClosedRemotely(SelectionKey sk, SocketChannel readChannel, TcpAddress incomingAddress) throws IOException { logger.debug("Socket closed remotely"); sk.cancel(); readChannel.close(); TransportStateEvent e = new TransportStateEvent(DefaultTcpTransportMapping.this, incomingAddress, TransportStateEvent. STATE_DISCONNECTED_REMOTELY, null); fireConnectionStateChanged(e); sockets.remove(incomingAddress); }
timeoutSocket(entry); TransportStateEvent e = new TransportStateEvent(TLSTM.this, incomingAddress, TransportStateEvent. null); fireConnectionStateChanged(e); if (e.isCancelled()) { logger.warn("Incoming connection cancelled"); s.close(); readChannel.close(); TransportStateEvent e = new TransportStateEvent(TLSTM.this, incomingAddress, TransportStateEvent.
timeoutSocket(entry); TransportStateEvent e = new TransportStateEvent(DefaultTcpTransportMapping.this, incomingAddress, TransportStateEvent. null); fireConnectionStateChanged(e); if (e.isCancelled()) { logger.warn("Incoming connection cancelled"); s.close(); readChannel.close(); TransportStateEvent e = new TransportStateEvent(DefaultTcpTransportMapping.this, incomingAddress, TransportStateEvent.
protected void socketClosedRemotely(SelectionKey sk, SocketChannel readChannel, TcpAddress incomingAddress) throws IOException { logger.debug("Socket closed remotely"); sk.cancel(); readChannel.close(); TransportStateEvent e = new TransportStateEvent(DefaultTcpTransportMapping.this, incomingAddress, TransportStateEvent. STATE_DISCONNECTED_REMOTELY, null); fireConnectionStateChanged(e); sockets.remove(incomingAddress); }
timeoutSocket(entry); TransportStateEvent e = new TransportStateEvent(TLSTM.this, incomingAddress, TransportStateEvent. null); fireConnectionStateChanged(e); if (e.isCancelled()) { logger.warn("Incoming connection cancelled"); s.close(); readChannel.close(); TransportStateEvent e = new TransportStateEvent(TLSTM.this, incomingAddress, TransportStateEvent.
logger.warn(iox); TransportStateEvent e = new TransportStateEvent(TLSTM.this, incomingAddress, TransportStateEvent.
timeoutSocket(entry); TransportStateEvent e = new TransportStateEvent(DefaultTcpTransportMapping.this, incomingAddress, TransportStateEvent. null); fireConnectionStateChanged(e); if (e.isCancelled()) { logger.warn("Incoming connection cancelled"); s.close();
@Override protected TcpAddress writeData(SelectionKey sk, TcpAddress incomingAddress) { SocketEntry entry = (SocketEntry) sk.attachment(); try { SocketChannel sc = (SocketChannel) sk.channel(); incomingAddress = new TcpAddress(sc.socket().getInetAddress(), sc.socket().getPort()); if ((entry != null) && (!entry.hasMessage())) { synchronized (pending) { pending.remove(entry); entry.removeRegistration(selector, SelectionKey.OP_WRITE); } } if (entry != null) { writeMessage(entry, sc); } } catch (IOException iox) { logger.warn(iox); TransportStateEvent e = new TransportStateEvent(TLSTM.this, incomingAddress, TransportStateEvent. STATE_DISCONNECTED_REMOTELY, iox); fireConnectionStateChanged(e); // make sure channel is closed properly: closeChannel(sk.channel()); } return incomingAddress; }
timeoutSocket(entry); TransportStateEvent e = new TransportStateEvent(DefaultTcpTransportMapping.this, incomingAddress, TransportStateEvent. null); fireConnectionStateChanged(e); if (e.isCancelled()) { logger.warn("Incoming connection cancelled"); s.close();
logger.warn(iox); TransportStateEvent e = new TransportStateEvent(DefaultTcpTransportMapping.this, incomingAddress, TransportStateEvent.
logger.warn(iox); TransportStateEvent e = new TransportStateEvent(tcpTransportMapping, incomingAddress, TransportStateEvent.
logger.warn(iox); TransportStateEvent e = new TransportStateEvent(DefaultTcpTransportMapping.this, incomingAddress, TransportStateEvent.
public void closeSession() { if (sslEngine.getSession().isValid()) { ByteBuffer outNetBuffer = ByteBuffer.allocate(getMaxInboundMessageSize()); try { SSLEngineResult sslEngineResult; do { sslEngineResult = sslEngine.wrap(ByteBuffer.allocate(0), outNetBuffer); outNetBuffer.flip(); socket.send(new DatagramPacket(outNetBuffer.array(), outNetBuffer.limit(), getPeerAddress().getInetAddress(), getPeerAddress().getPort())); } while ((sslEngineResult.getStatus() != Status.CLOSED) && (sslEngineResult.getHandshakeStatus() == NEED_WRAP)); } catch (Exception e) { logger.error("DTLSM: Exception while closing TLS session " + this + ": " + e.getMessage(), e); } } sslEngine.closeOutbound(); counterSupport.fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionServerCloses)); TransportStateEvent e = new TransportStateEvent(DTLSTM.this, getPeerAddress(), TransportStateEvent.STATE_CLOSED, null); fireConnectionStateChanged(e); } }
logger.debug("Fire connected event for "+addr); TransportStateEvent e = new TransportStateEvent(DefaultTcpTransportMapping.this, addr, TransportStateEvent.
logger.debug("Fire connected event for "+addr); TransportStateEvent e = new TransportStateEvent(DefaultTcpTransportMapping.this, addr, TransportStateEvent.
logger.debug("Fire connected event for "+addr); TransportStateEvent e = new TransportStateEvent(TLSTM.this, addr, TransportStateEvent.
logger.debug("Fire connected event for " + addr); TransportStateEvent e = new TransportStateEvent(tcpTransportMapping, addr, TransportStateEvent.
entry.getSocket().getChannel().close(); TransportStateEvent e = new TransportStateEvent(TLSTM.this, entry.getPeerAddress(), TransportStateEvent.STATE_CLOSED, entry.getSocket().getChannel().close(); TransportStateEvent e = new TransportStateEvent(TLSTM.this, entry.getPeerAddress(), TransportStateEvent.STATE_CLOSED,
entry.getSocket().getChannel().close(); TransportStateEvent e = new TransportStateEvent(DefaultTcpTransportMapping.this, entry.getPeerAddress(), TransportStateEvent.STATE_CLOSED, entry.getSocket().getChannel().close(); TransportStateEvent e = new TransportStateEvent(DefaultTcpTransportMapping.this, entry.getPeerAddress(), TransportStateEvent.STATE_CLOSED,
entry.getSocket().getChannel().close(); TransportStateEvent e = new TransportStateEvent(DefaultTcpTransportMapping.this, entry.getPeerAddress(), TransportStateEvent.STATE_CLOSED, entry.getSocket().getChannel().close(); TransportStateEvent e = new TransportStateEvent(DefaultTcpTransportMapping.this, entry.getPeerAddress(), TransportStateEvent.STATE_CLOSED,