Package com.orientechnologies.orient.server.network.protocol

Examples of com.orientechnologies.orient.server.network.protocol.ONetworkProtocol


    return active;
  }

  @Override
  public void run() {
    ONetworkProtocol protocol;
    OClientConnection connection;

    try {
      while (active) {
        try {
          // listen for and accept a client connection to serverSocket
          Socket socket = serverSocket.accept();

          socket.setPerformancePreferences(0, 2, 1);
          socket.setSendBufferSize(socketBufferSize);
          socket.setReceiveBufferSize(socketBufferSize);

          // CREATE A NEW PROTOCOL INSTANCE
          protocol = protocolType.newInstance();

          // CREATE THE CLIENT CONNECTION
          connection = OClientConnectionManager.instance().connect(socket, protocol);

          // CONFIGURE THE PROTOCOL FOR THE INCOMING CONNECTION
          protocol.config(server, socket, connection, configuration);

          if (commands != null)
            // REGISTER ADDITIONAL COMMANDS
            for (OServerCommand c : commands) {
              protocol.registerCommand(c);
            }

        } catch (Throwable e) {
          OLogManager.instance().error(this, "Error on client connection", e);
        } finally {
View Full Code Here


   * @param connection
   *          connection to kill
   */
  public void kill(final OClientConnection connection) {
    if (connection != null) {
      final ONetworkProtocol protocol = connection.protocol;
      disconnect(connection);

      // KILL THE NETWORK MANAGER TOO
      protocol.sendShutdown();
    }
  }
View Full Code Here

   *          id of connection
   */
  public void interrupt(final int iChannelId) {
    final OClientConnection connection = connections.get(iChannelId);
    if (connection != null) {
      final ONetworkProtocol protocol = connection.protocol;
      if (protocol != null)
        // INTERRUPT THE NEWTORK MANAGER TOO
        protocol.interrupt();
    }
  }
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.server.network.protocol.ONetworkProtocol

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.