Examples of SocketAddress


Examples of fr.dyade.aaa.common.net.SocketAddress

  final Socket createSocket(ServerDesc server) throws IOException {
    if (server == null)
      throw new ConnectException("Cannot connect to null server");
   
    for (Enumeration e = server.getSockAddrs(); e.hasMoreElements();) {
      SocketAddress sa = (SocketAddress) e.nextElement();

      if (this.logmon.isLoggable(BasicLevel.DEBUG))
        this.logmon.log(BasicLevel.DEBUG,
                        this.getName() + ", try to connect server#" +
                        server.getServerId() +
                        ", addr=" + sa.getHostname() +
                        ", port=" + sa.getPort());
                 
      try {
        Socket socket = createSocket(sa);

        if (this.logmon.isLoggable(BasicLevel.DEBUG))
View Full Code Here

Examples of fr.dyade.aaa.common.net.SocketAddress

        String hostname,
                    int port) {
    this.sid = sid;
    this.name = name;
    sockAddrs = new Vector();
    sockAddrs.addElement(new SocketAddress(hostname,port));
  }
View Full Code Here

Examples of fr.dyade.aaa.common.net.SocketAddress

    ((SocketAddress) sockAddrs.firstElement()).resetAddr();
    return getAddr();
  }

  void addSockAddr(String hostname, int port) {
    sockAddrs.addElement(new SocketAddress(hostname, port));
  }
View Full Code Here

Examples of fr.dyade.aaa.common.net.SocketAddress

    sockAddrs.addElement(new SocketAddress(hostname, port));
  }

  public void updateSockAddr(String hostname, int port) {
    sockAddrs.remove(0);
    sockAddrs.insertElementAt(new SocketAddress(hostname,port), 0);
  }
View Full Code Here

Examples of io.vertx.core.net.SocketAddress

  }

  @Test
  public void testRemoteAddress() throws Exception {
    server.connectHandler(socket -> {
      SocketAddress addr = socket.remoteAddress();
      assertEquals("127.0.0.1", addr.hostAddress());
    }).listen(ar -> {
      assertTrue(ar.succeeded());
      vertx.createNetClient(new NetClientOptions()).connect(1234, "localhost", result -> {
        NetSocket socket = result.result();
        SocketAddress addr = socket.remoteAddress();
        assertEquals("127.0.0.1", addr.hostAddress());
        assertEquals(addr.hostPort(), 1234);
        testComplete();
      });
    });
    await();
  }
View Full Code Here

Examples of java.net.SocketAddress

    public SocketClientInstance(ObjectChannel objectSocket, ClientServiceRegistryImpl csr, boolean isClientEncryptionEnabled) {
        this.objectSocket = objectSocket;
        this.csr = csr;
        this.workContext.setSecurityHelper(csr.getSecurityHelper());
        this.usingEncryption = isClientEncryptionEnabled;
        SocketAddress address = this.objectSocket.getRemoteAddress();
        if (address instanceof InetSocketAddress) {
          InetSocketAddress addr = (InetSocketAddress)address;
          this.workContext.setClientAddress(addr.getAddress().getHostAddress());
          this.workContext.setClientHostname(addr.getHostName());
        }
View Full Code Here

Examples of java.net.SocketAddress

            if (logmon.isLoggable(BasicLevel.DEBUG)) {
              logmon.log(BasicLevel.DEBUG, this.getName() + ", received message from: " + " "
                  + packet.getAddress() + ":" + packet.getPort());
            }

            SocketAddress socketAddress = packet.getSocketAddress();
            ServerInfo srvInfo = ((ServerInfo) serversInfo.get(socketAddress));
            if (srvInfo == null) {
              srvInfo = new ServerInfo();
              try {
                MXWrapper.registerMBean(srvInfo, "AgentServer", getMBeanName(socketAddress.toString()
                    .replace(':', '#')));
              } catch (Exception exc) {
                logmon.log(BasicLevel.ERROR, getName() + " jmx failed", exc);
              }
              serversInfo.put(socketAddress, srvInfo);
View Full Code Here

Examples of java.net.SocketAddress

            Enumeration enuAddr = serversInfo.keys();
            long currentTimeMillis = System.currentTimeMillis();
           
            while (enuAddr.hasMoreElements()) {
              SocketAddress addr = (SocketAddress) enuAddr.nextElement();
              ServerInfo servInfo = (ServerInfo) serversInfo.get(addr);
             
              synchronized (servInfo.lock) {
               
                if (!hasBeenForced
View Full Code Here

Examples of java.net.SocketAddress

                // if no local address has been configured, make sure we use the same as the client connects from
                if(localAddr == null) {
                    localAddr = ((InetSocketAddress)session.getLocalAddress()).getAddress();
                }      

                SocketAddress localSocketAddress = new InetSocketAddress(localAddr, dataConfig.getActiveLocalPort());
               
                LOG.debug("Binding active data connection to {}", localSocketAddress);
                dataSoc.bind(localSocketAddress);

                dataSoc.connect(new InetSocketAddress(address, port));
View Full Code Here

Examples of java.net.SocketAddress

     */
    public SocketAddress getRemoteAddress() {
  // when closing a socket, the remote address might be reset to null
  // therefore, we attempt to keep a cached copy around

  SocketAddress address = wrappedSession.getRemoteAddress();
  if (address == null
    && containsAttribute(ATTRIBUTE_CACHED_REMOTE_ADDRESS)) {
      return (SocketAddress) getAttribute(ATTRIBUTE_CACHED_REMOTE_ADDRESS);
  } else {
      setAttribute(ATTRIBUTE_CACHED_REMOTE_ADDRESS, address);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.