Package java.net

Examples of java.net.SocketAddress


   *         down
   */
  public Closeable initialize() {
    try {
      Connection connection = new SocketConnection(this);
      SocketAddress address = new InetSocketAddress(PORT_NUMBER);
      connection.connect(address);
      logger.info("HTTP service for ExtensionSwap installation running on port {}", PORT_NUMBER);
      return connection;
    } catch (IOException e) {
      logger.warn("Could not host HTTP service for ExtensionSwap installation on port " + PORT_NUMBER
View Full Code Here


    doConnect();
    timer.stop();
  }

  protected void doConnect() throws IOException {
    SocketAddress address = getSocketAddress(host);
    socket.connect(address, timeout);
    socket.setSoLinger(true, 60);
  }
View Full Code Here

     
        log.debug("Message recv...");
       
        if (message instanceof ClientFrameBean) {
     
      SocketAddress remoteAddress = session.getRemoteAddress();
     
      log.debug("Recv Frame Bean ");
     
      ClientViewerScreen.instance.addClientFrameBean((ClientFrameBean) message);
     
    }
   
    if (message instanceof ClientStatusBean) {
     
      ClientStatusBean cBean = (ClientStatusBean) message;
     
      SocketAddress remoteAddress = session.getRemoteAddress();
     
      log.debug("Recv Status Bean "+cBean.getMode());
     
      if (cBean.getMode() == 4) {
        if (ClientViewerScreen.instance != null) {
          ClientViewerScreen.instance.showWarningPopUp(ClientViewerScreen.instance.label736);
          ClientViewerScreen.instance.alreadyClosedWarning = true;
          ClientTransportMinaPool.closeSession();
        }
       
      }
     
    }
   
    if (message instanceof ClientCursorStatus) {
     
      ClientCursorStatus clientCursorStatus = (ClientCursorStatus) message;
     
      SocketAddress remoteAddress = session.getRemoteAddress();
     
      log.debug("Recv Status Bean "+clientCursorStatus.getMode());
     
      ClientViewerScreen.instance.updateCursor(clientCursorStatus);
     
View Full Code Here

    log.debug("messageReceived"+message.getClass().getName());
   
    if (message instanceof ServerFrameBean) {
     
      SocketAddress remoteAddress = session.getRemoteAddress();
     
      server.recvServerFrameBean(remoteAddress, (ServerFrameBean) message);
     
    }
   
    if (message instanceof ServerStatusBean) {
     
      SocketAddress remoteAddress = session.getRemoteAddress();
     
      server.recvServerStatusBean(remoteAddress, session.getId(), (ServerStatusBean) message);
     
    }
   
    if (message instanceof ServerViewerRegisterBean) {
     
      SocketAddress remoteAddress = session.getRemoteAddress();
     
      server.recvServerViewerRegisterBean(remoteAddress, session.getId(), (ServerViewerRegisterBean) message);
     
    }
   
    if (message instanceof ServerFrameCursorStatus) {
     
      SocketAddress remoteAddress = session.getRemoteAddress();
     
      //log.debug("incoming ServerFrameCursorStatus");
      server.updateClientCursor(remoteAddress, (ServerFrameCursorStatus) message);
     
    }
View Full Code Here

  @Override
  public void sessionClosed(IoSession session) throws Exception {

    log.debug("Session closed...");

    SocketAddress remoteAddress = session.getRemoteAddress();

    server.removeClient(remoteAddress, session.getId());

  }
View Full Code Here

//            ((SocketSessionConfig) session.getConfig()).setTcpNoDelay(true);
//        }
//   
    session.getConfig().setIdleTime(IdleStatus.BOTH_IDLE, 10);
   
    SocketAddress remoteAddress = session.getRemoteAddress();

    server.addClient(remoteAddress);
   
  }
View Full Code Here

   * @param session
   *            the session
   */
  private void blockSession(Channel session)
  {
    SocketAddress remoteAddress = session.getRemoteAddress();
    // logger.warn("Remote address " + remoteAddress +
    // " not in the whitelist; closing.");
    session.close();
  }
View Full Code Here

   *
   * @return true, if is blocked
   */
  private boolean isBlocked(Channel session)
  {
    SocketAddress remoteAddress = session.getRemoteAddress();
    if (remoteAddress instanceof InetSocketAddress)
    {
      if (whitelist.contains(((InetSocketAddress) remoteAddress).getAddress()))
      {
        return false;
View Full Code Here

        return getsockname(getRuntime().getCurrentContext());
    }

    @JRubyMethod(name = {"getsockname", "__getsockname"})
    public IRubyObject getsockname(ThreadContext context) {
        SocketAddress sock = getLocalSocket();
        if(null == sock) {
            throw context.getRuntime().newIOError("Not Supported");
        }
        return context.getRuntime().newString(sock.toString());
    }
View Full Code Here

    public IRubyObject getpeername() {
        return getpeername(getRuntime().getCurrentContext());
    }
    @JRubyMethod(name = {"getpeername", "__getpeername"})
    public IRubyObject getpeername(ThreadContext context) {
        SocketAddress sock = getRemoteSocket();
        if(null == sock) {
            throw context.getRuntime().newIOError("Not Supported");
        }
        return context.getRuntime().newString(sock.toString());
    }
View Full Code Here

TOP

Related Classes of java.net.SocketAddress

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.