Initialize the connection with the Socket in the server.
@param parameters Configuration.
548366
@Override
	public void open(Configuration parameters) throws Exception {
		try {
			client = new Socket(hostIp, port);
			outputStream = client.getOutputStream();
			streamWriter = new DataOutputViewStreamWrapper(outputStream);
		}
		catch (IOException e) {
			throw new IOException("Cannot connect to the client to send back the stream", e);
		}
	}
1171660
public synchronized SimpleSocketPoolImpl init(ClientSocketPoolParameters parameters) {
		if (!ServerUtil.checkHostAndPort(parameters.getHost(), parameters.getPort()))
			throw new IllegalArgumentException("Server host or port is null !");
		SimpleSocketPoolImpl self = new SimpleSocketPoolImpl();
		selfMap.put(parameters.getKey(), self);
		self.socketPool = new Hashtable<>(size);
		self.socketStatusArray = new boolean[size];
		// 初始化连接池
		log.debug("Initiation pool ......");
		buildThriftSocketPool(parameters);
		return self;
	}
821509
public void setParameters(SortedMap<String, String> parameters) {

        m_parameters = new TreeMap<String, String>(parameters);
    }
1077812
public void setParameters(java.util.Collection<ProcessorParameter> parameters) {
        if (parameters == null) {
            this.parameters = null;
            return;
        }

        this.parameters = new java.util.ArrayList<ProcessorParameter>(parameters);
    }
178971
@Override
    public void initialize() {

        String ip;
        String localIp;
        int localPort;
        int remotePort;

        if (this.getLocal().getSymmetric() != null) {
            ip = this.getLocal().getIp();
            localIp = this.getLocal().getLocalIp();
            localPort = getFreePort();
            remotePort = this.getLocal().getSymmetric().getPort();

            LOGGER.fine(this.getLocal().getConnection() + " " + ip + ": " + localPort + "->" + remotePort);

        }
        else {
            ip = this.getRemote().getIp();
            localIp = this.getLocal().getLocalIp();
            localPort = this.getLocal().getPort();
            remotePort = this.getRemote().getPort();
        }

        audioChannel = new AudioChannel(new MediaLocator(this.getMediaLocator()), localIp, ip, localPort, remotePort, AudioFormatUtils.getAudioFormat(this.getPayloadType()),this);
    }
696425
public Connector withParameters(java.util.Map<String, String> parameters) {
        setParameters(parameters);
        return this;
    }
327567
private static void serverOptionInit() {
        Map<String, Object> mapConfig = Config.getInstance().getJsonMapConfigNoCache(SERVER_CONFIG_NAME);
        ServerOption.serverOptionInit(mapConfig, getServerConfig());
    }
222034
public void initialize() throws IOException, NotInitializedException {
    logger.debug("Initialising TCPTransportClient. Origin address is [{}] and destination address is [{}]", origAddress, destAddress);
    if (destAddress == null) {
      throw new NotInitializedException("Destination address is not set");
    }
    socketChannel = SelectorProvider.provider().openSocketChannel();

    try {
      if (origAddress != null) {
        socketChannel.socket().bind(origAddress);
      }

      socketChannel.connect(destAddress);
      //PCB added logging
      socketChannel.configureBlocking(BLOCKING_IO);
      getParent().onConnected();
    }
    catch (IOException e) {
      if (origAddress != null) {
        socketChannel.socket().close();
      }
      socketChannel.close();
      throw e;
    }
  }
52754
public void init(SocketChannel s)
  {
    _s = s;

    try {
      s.setOption(StandardSocketOptions.TCP_NODELAY, true);
    } catch (Exception e) {
      e.printStackTrace();;
    }
    //_is = null;
    //_os = null;
    _needsFlush = false;
    
    _readBuffer.clear().flip();
    _writeBuffer.clear();
  }
906236
@Override
    public void configure(String parameters) {
        if (parameters.isEmpty()) {
            return;
        }
        List<String> values = Op.split(parameters, " ");
        int required = 4;
        if (values.size() < required) {
            throw new RuntimeException(String.format(
                    "[configuration error] term <%s> requires <%d> parameters",
                    this.getClass().getSimpleName(), required));
        }
        Iterator<String> it = values.iterator();
        setMeanA(Op.toDouble(it.next()));
        setStandardDeviationA(Op.toDouble(it.next()));
        setMeanB(Op.toDouble(it.next()));
        setStandardDeviationB(Op.toDouble(it.next()));
        if (values.size() > required) {
            setHeight(Op.toDouble(it.next()));
        }
    }
1102777
private void initConnectionSettings(Configuration conf,
      ClientConfiguration clientConf) throws IOException {
    clientConf.setMaxConnections(Utils.getInt(conf, FS_COS, FS_ALT_KEYS,
        MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS));
    clientConf.setClientExecutionTimeout(Utils.getInt(conf, FS_COS, FS_ALT_KEYS,
        CLIENT_EXEC_TIMEOUT, DEFAULT_CLIENT_EXEC_TIMEOUT));
    clientConf.setMaxErrorRetry(Utils.getInt(conf, FS_COS, FS_ALT_KEYS,
        MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES));
    clientConf.setConnectionTimeout(Utils.getInt(conf, FS_COS, FS_ALT_KEYS,
        ESTABLISH_TIMEOUT, DEFAULT_ESTABLISH_TIMEOUT));
    clientConf.setSocketTimeout(Utils.getInt(conf, FS_COS, FS_ALT_KEYS,
        SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT));
    clientConf.setRequestTimeout(Utils.getInt(conf, FS_COS, FS_ALT_KEYS,
        REQUEST_TIMEOUT, DEFAULT_REQUEST_TIMEOUT));
    int sockSendBuffer = Utils.getInt(conf, FS_COS, FS_ALT_KEYS,
        SOCKET_SEND_BUFFER, DEFAULT_SOCKET_SEND_BUFFER);
    int sockRecvBuffer = Utils.getInt(conf, FS_COS, FS_ALT_KEYS,
        SOCKET_RECV_BUFFER, DEFAULT_SOCKET_RECV_BUFFER);
    clientConf.setSocketBufferSizeHints(sockSendBuffer, sockRecvBuffer);
    String signerOverride = Utils.getTrimmed(conf, FS_COS, FS_ALT_KEYS,
        SIGNING_ALGORITHM, "");
    if (!signerOverride.isEmpty()) {
      LOG.debug("Signer override = {}", signerOverride);
      clientConf.setSignerOverride(signerOverride);
    }

    String userAgentPrefix = Utils.getTrimmed(conf, FS_COS, FS_ALT_KEYS,
        USER_AGENT_PREFIX, DEFAULT_USER_AGENT_PREFIX);
    String userAgentName = singletoneInitTimeData.getUserAgentName();
    if (!userAgentPrefix.equals(DEFAULT_USER_AGENT_PREFIX)) {
      userAgentName = userAgentPrefix + " " + userAgentName;
    }
    clientConf.setUserAgentPrefix(userAgentName);
  }
22930
public final void initialize() {
        if (m_state.isInitialized()) {
            m_logger.warn("initialize(): Service is already initialized -- ignoring");
        } else {
            logParams("Initializing with the following service parameters:");
            this.initService();
            setState(State.INITIALIZED);
        }
    }
297517
@Override
    public void configure(String parameters) {
        if (parameters.isEmpty()) {
            return;
        }
        setValue(Op.toDouble(parameters));
    }
442596
private void doSocketConnect(InetSocketAddress addr) throws IOException{
        SocketChannel sock = createSock();
        registerAndConnect(sock, addr);
    }
14990
protected void init(MuxServer server, int channel)
        throws IOException
    {
        this.server = server;
        this.channel = channel;

        this.url = null;

        chunkLength = 0;
    }
163973
public synchronized void init(int serverPort)
    {
        if (this.initialized)
        {
            return;
        }

        String hostname = null;

        try
        {
            hostname = InetAddress.getLocalHost().getHostName();
        }
        catch (UnknownHostException ex)
        {
            logger.warn("Get host failed. Use localhost.", ex);
        }

        logger.info("WebSocket server initialize. : HostName={}, Port={}, Path={}, Object={}",
                hostname, serverPort, "/", this.toString());
        this.server = new Server(hostname, serverPort, "/", null, AmLogServerEndPoint.class);
        try
        {
            this.server.start();
        }
        catch (DeploymentException ex)
        {
            logger.warn("WebSocket server initialize failed. Skip initialize.", ex);
        }

        this.initialized = true;
    }
1143156
public void start() throws IOException {
    server = ServerSocketChannel.open();
    server.configureBlocking(false);
    server.socket().setReuseAddress(true);
    server.socket().bind(new InetSocketAddress(port));

    monitor.add(server, this, SelectionKey.OP_ACCEPT);

    // Print a message when we are waiting to connect manually
    if (manualConnect) {
      System.out.println("Ready to accept connections on port " + port);
    }
  }