@Override public SocketAddress remoteAddress() { return session.getRemoteAddress(); }
@Override public SocketAddress remoteAddress() { return session.getRemoteAddress(); }
@Override public byte[] getAddress() throws UnknownHostException { final SocketAddress remoteAddress = ioSession.getRemoteAddress(); if (remoteAddress == null) throw new UnknownHostException(); final InetSocketAddress socketAddress = (InetSocketAddress) remoteAddress; final InetAddress address = socketAddress.getAddress(); return address.getAddress(); }
@Override public String getHostAddress() throws UnknownHostException { final SocketAddress remoteAddress = ioSession.getRemoteAddress(); if (remoteAddress == null) throw new UnknownHostException(); final InetSocketAddress socketAddress = (InetSocketAddress) remoteAddress; final InetAddress inetAddress = socketAddress.getAddress(); return inetAddress.getHostAddress(); }
@Override public String getHostName() throws UnknownHostException { final SocketAddress remoteAddress = ioSession.getRemoteAddress(); if (remoteAddress == null) throw new UnknownHostException(); final InetSocketAddress socketAddress = (InetSocketAddress) remoteAddress; final InetAddress inetAddress = socketAddress.getAddress(); return inetAddress.getHostName(); }
private ObjectName getObjectNameForSession( IoSession session ) throws MalformedObjectNameException { return new ObjectName( prefix + ":type=IoSession,name=" + session.getRemoteAddress().toString().replace( ':', '/' ) ); }
/** {@inheritDoc} */ @Override public void sessionIdle(IoSession session, IdleStatus status) throws Exception { if (log.isTraceEnabled()) { log.trace("Idle (session: {}) local: {} remote: {}\nread: {} write: {}", session.getId(), session.getLocalAddress(), session.getRemoteAddress(), session.getReadBytes(), session.getWrittenBytes()); } String sessionId = (String) session.getAttribute(RTMPConnection.RTMP_SESSION_ID); if (sessionId != null) { RTMPMinaConnection conn = (RTMPMinaConnection) RTMPConnManager.getInstance().getConnectionBySessionId(sessionId); if (conn != null) { // close the idle socket conn.onInactive(); } } }
boolean isClient = session.getRemoteAddress().equals(forward); if (log.isDebugEnabled()) { log.debug("Is downstream: " + isClient);
SyslogUtils.getIP(session.getRemoteAddress())); SyslogUtils.getHostname(session.getRemoteAddress()));
@Override public void sessionCreated(IoSession session) throws Exception { super.sessionCreated(session); Line line = state.getOrCreateLine((InetSocketAddress)session.getRemoteAddress()); session.setAttribute("line", line); logger.debug("Session[{}] created", session.getId()); }
@Override public void run() { state.setSelfAddress(telex.getTo()); logger.debug("SELF[{} = {}]", state.getSelfAddress(), state.getSelfHash()); Line line = state.getOrCreateLine(state.getSelfAddress()); if (line == null) { return; } line.setVisible(true); line.getRules().addAll(tapRules); if (state.getSelfAddress().equals(session.getRemoteAddress())) { logger.debug("We're the seed."); } processTelex(session, telex, br); // start scanning thread startScannerThread(); } });
@Override public void messageReceived(IoSession session, Object message) throws Exception { if (message instanceof IoBuffer) { IoBuffer buffer = (IoBuffer) message; String response = buffer.getString(decoder); int br = response.getBytes().length; logger.debug("RECV[{}] from {}: {} bytes: {}", new Object[]{ session.getId(), (InetSocketAddress)session.getRemoteAddress(), br, response}); Telex telex = (Telex) JsonMapper.fromJson(response, TelehashPackage.Literals.TELEX); switch (state.getConnectionStatus()) { case SEEDING: completeBootstrap(session, telex, br); break; case CONNECTED: processTelex(session, telex, br); break; } } }
@Override public String getHostName() throws UnknownHostException { final SocketAddress remoteAddress = ioSession.getRemoteAddress(); if (remoteAddress == null) throw new UnknownHostException(); final InetSocketAddress socketAddress = (InetSocketAddress) remoteAddress; final InetAddress inetAddress = socketAddress.getAddress(); return inetAddress.getHostName(); }
public void messageSent( IoSession session, Object message ) { if ( LOG.isDebugEnabled() ) { LOG.debug( "{} -> {} SENT: " + message, session.getRemoteAddress(), session.getLocalAddress() ); } }
/** * Creates the host port. * * @param session the session * @return the host port */ protected HostPort createHostPort(IoSession session) { InetSocketAddress remote = (InetSocketAddress) session.getRemoteAddress(); return new HostPort(remote.getHostName(), remote.getPort()); }
/** * {@inheritDoc} */ @Override public void remove(IoSession session) { sessionMap.remove(session.getRemoteAddress()); }
/** * {@inheritDoc} */ @Override public void remove(IoSession session) { sessionMap.remove(session.getRemoteAddress()); }
@Override public boolean accept(IoSession session) { SocketAddress remoteAddress = session.getRemoteAddress(); return RemoteIpChecker.ipAllowed(remoteAddress, prefsBean, logger); } });
private String getLogSuffix(SessionID sessionID, IoSession protocolSession) { String suffix = ":"; if (sessionID != null) { suffix += "sessionID=" + sessionID.toString() + ";"; } if (protocolSession != null) { suffix += "address=" + protocolSession.getRemoteAddress(); } return suffix; }
/** * {@inheritDoc} */ @Override public void put(IoSession session) { mapExpirer.startExpiringIfNotStarted(); SocketAddress key = session.getRemoteAddress(); if (!sessionMap.containsKey(key)) { sessionMap.put(key, session); } }