/*
@see com.ibm.wsspi.channelfw.Channel#start()
514513
public void start() throws ChannelException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(this, tc, "start; " + getName());
        }
        if (stoppedFlag) // only start once
        {
            stoppedFlag = false;
            if (getConfig().isInboundChannel()) {
                inboundNetworkLayer = new UDPNetworkLayer(this, workQueueManager, getConfig().getHostname(), getConfig().getPort());
                try {
                    inboundNetworkLayer.initDatagramSocket(null);
                } catch (IOException e) {
                    stoppedFlag = true;
                    throw new RetryableChannelException(e);
                }

                String IPvType = "IPv4";
                if (inboundNetworkLayer.getDatagramSocket().getInetAddress() instanceof Inet6Address) {
                    IPvType = "IPv6";
                }

                String hostname = getConfig().getHostname();
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(this, tc, "getHostname():  >" + hostname + "<");

                if ((hostname == null) || (hostname.equals("*"))) {
                    displayableHostName = "*  (" + IPvType + ")";
                } else {
                    InetAddress addr = inboundNetworkLayer.getDatagramSocket().getLocalAddress();
                    displayableHostName = addr.getHostName() + "  (" + IPvType + ": " + addr.getHostAddress() + ")";
                }
                Tr.info(tc, "CWUDP0001I", new Object[] { getConfig().getExternalName(), displayableHostName, String.valueOf(inboundNetworkLayer.getListenPort()) });
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(this, tc, "start");
        }
    }
836217
@Override
    @Trivial
    public void init() throws ChannelException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Init channel: " + this);
        }
    }
361276
public void start(String channelId) throws AlluxioStatusException {
    try {
      LOG.debug("Starting SASL handshake for ChannelId:{}", channelId);
      // Send the server initial message.
      mRequestObserver.onNext(mSaslHandshakeClientHandler.getInitialMessage(channelId));
      // Wait until authentication status changes.
      mAuthenticated.get(mGrpcAuthTimeoutMs, TimeUnit.MILLISECONDS);
    } catch (SaslException se) {
      throw new UnauthenticatedException(se.getMessage(), se);
    } catch (InterruptedException ie) {
      Thread.currentThread().interrupt();
      throw new UnavailableException(ie.getMessage(), ie);
    } catch (ExecutionException e) {
      Throwable cause = (e.getCause() != null) ? e.getCause() : e;
      if (cause != null && cause instanceof StatusRuntimeException) {
        StatusRuntimeException sre = (StatusRuntimeException) cause;
        // If caught unimplemented, that means server does not support authentication.
        if (sre.getStatus().getCode() == Status.Code.UNIMPLEMENTED) {
          throw new UnauthenticatedException("Authentication is disabled on target host.");
        }
        throw AlluxioStatusException.fromStatusRuntimeException((StatusRuntimeException) cause);
      }
      throw new UnknownException(cause.getMessage(), cause);
    } catch (TimeoutException e) {
      throw new UnavailableException(e);
    }
  }
295683
public void start()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "start");

    if(!started)
    {
      started = true;
      if(keyGroup != null)
        keyGroup.startMember();
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "start");
  }
1310305
synchronized void started() {
        try {
            if(isConnected()) {
                channelHandler.executeRequest(new ServerStartedRequest(), null).getResult().await();
            }
        } catch (Exception e) {
            ServerLogger.AS_ROOT_LOGGER.debugf(e, "failed to send started notification");
        }
    }
814364
def start(self):
        """"""
        old_start_count = self.__start_count
        self.__start_count += 1
        if old_start_count == 0:
            self.data_channel_start_event.fire()
678778
public void start() {
		if (tryToStart()) {
			throw new IllegalStateException("The StreamServer is already started");
		}
		logger.debug("StreamServer starting {}:{}", serverSocket.getInetAddress(), serverSocket.getLocalPort());
		keepRunning.set(true);
		executor.submit(new Server());
	}
1170382
@Override
  public void start() throws Exception {
    mJournalSystem.start();
    mJournalSystem.gainPrimacy();
    startMaster(true);
    startServing();
  }
792283
public void start() 
		{
		        try 
		        {
		            this.regularBootstrap.bind(new InetSocketAddress(regularConfiguration.getHost(), regularConfiguration.getPort()));
		            if(logger.isInfoEnabled()) {
		            logger.info(regularConfiguration.getName() + " started at " + regularConfiguration.getHost() + " : " + regularConfiguration.getPort());
		            }
		            if(this.securedConfiguration!=null)
		            {
		            	this.securedBootstrap.bind(new InetSocketAddress(securedConfiguration.getHost(), securedConfiguration.getPort()));	
		            	if(logger.isInfoEnabled()) {
		            	logger.info(securedConfiguration.getName() + " uses port : " + securedConfiguration.getPort() + " for TLS clients.");
		            	}
		            }
		        } 
		        catch (ChannelException e) 
		        {
		        	logger.error("Smpp Channel Exception:", e);
		        }
		}
886512
public void start(String[] args) {
        try {
            processEnvironmentOptions();
            processCommandLineOptions(args);
            initializeLogging();
            validateOptions();
            final ChaincodeID chaincodeId = ChaincodeID.newBuilder().setName(this.id).build();
            final ManagedChannelBuilder<?> channelBuilder = newChannelBuilder();
            final Handler handler = new Handler(chaincodeId, this);
            new ChaincodeSupportStream(channelBuilder, handler::onChaincodeMessage, handler::nextOutboundChaincodeMessage);
        } catch (Exception e) {
            logger.fatal("Chaincode could not start", e);
        }
    }
952126
@Override
	public void run() {

		// Read buffer
		ByteBuffer readBuffer = ByteBuffer.allocate(Math.min(maxPacketSize, 1024 * 1024));
		byte[] readArray = readBuffer.array();

		// Processing variables
		Iterator<SelectionKey> keys;
		SocketChannel channel;
		SelectionKey key;

		byte[] bytes;
		byte[] remaining;
		int processed;
		int pos;

		// Loop
		while (true) {

			// Waiting for sockets
			int n;
			try {
				n = selector.select(3000);
			} catch (NullPointerException nullPointer) {
				continue;
			} catch (Exception anyError) {
				break;
			}
			if (n < 1) {
				continue;
			}
			keys = selector.selectedKeys().iterator();
			while (keys.hasNext()) {
				key = keys.next();
				if (key == null) {
					continue;
				}
				if (!key.isValid()) {
					keys.remove();
					continue;
				}
				if (key.isAcceptable()) {

					// Accept channel
					try {

						// Register socket
						channel = serverChannel.accept();
						channel.configureBlocking(false);

						channel.setOption(StandardSocketOptions.SO_KEEPALIVE, true);
						channel.setOption(StandardSocketOptions.TCP_NODELAY, true);
						channel.setOption(StandardSocketOptions.SO_LINGER, -1);

						channel.register(selector, SelectionKey.OP_READ);

						// Debug
						if (debug) {
							logger.info("Client channel opened from " + channel.getRemoteAddress() + ".");
						}

					} catch (Exception cause) {
						close(key, cause);
					} finally {
						keys.remove();
					}

				} else if (key.isReadable()) {
					try {

						// Read bytes into the read buffer
						channel = (SocketChannel) key.channel();
						readBuffer.clear();
						n = channel.read(readBuffer);
						if (n < 0) {
							throw new EOFException();
						}
						if (n == 0) {
							keys.remove();
							continue;
						}

						// Debug
						if (debug) {
							logger.info(n + " bytes received from " + channel.getRemoteAddress() + ".");
						}

						// Get the incoming bytes
						bytes = new byte[n];
						System.arraycopy(readArray, 0, bytes, 0, n);

						// Add remaining bytes
						remaining = (byte[]) key.attachment();
						if (remaining != null) {
							byte[] tmp = new byte[remaining.length + bytes.length];
							System.arraycopy(remaining, 0, tmp, 0, remaining.length);
							System.arraycopy(bytes, 0, tmp, remaining.length, bytes.length);
							bytes = tmp;
							key.attach(null);
						}

						// Split data
						pos = 0;
						while ((processed = processPacket(bytes, pos)) > 0) {
							pos += processed;
						}

						// Has remaining?
						if (pos < bytes.length) {
							if (pos == 0) {
								remaining = bytes;
							} else {
								remaining = new byte[bytes.length - pos];
								System.arraycopy(bytes, pos, remaining, 0, remaining.length);
							}
							key.attach(remaining);
						}

					} catch (EOFException eof) {

						// Peer closed
						close(key, null);

					} catch (Exception cause) {
						close(key, cause);
					} finally {
						keys.remove();
					}
				}
			}
		}
	}
1193310
public void start()
	{
	  mThread = new Thread(mom);
	  mThread.setName("MonitorThead for " + si.getServerConnection().getUrl());
	  mThread.start();
	}
83814
@Process(actionType = InitBatch.class)
    public void init(final Dispatcher.Channel channel) {
        List<ModelNode> steps = new ArrayList<>();
        steps.add(readResourceOp(BATCH_ADDRESS));
        steps.add(readResourceOp(THREAD_POOL_ADDRESS));
        steps.add(readResourceOp(JOB_REPOSITORY_ADDRESS));
        steps.add(readThreadFactoriesOp());

        final ModelNode comp = new ModelNode();
        comp.get(ADDRESS).setEmptyList();
        comp.get(OP).set(COMPOSITE);
        comp.get(STEPS).set(steps);

        dispatcher.execute(new DMRAction(comp), new AsyncCallback<DMRResponse>() {
            @Override
            public void onFailure(Throwable caught) {
                channel.nack(caught);
            }

            @Override
            public void onSuccess(DMRResponse dmrResponse) {
                ModelNode response = dmrResponse.get();
                if (response.isFailure()) {
                    channel.nack(new RuntimeException("Failed to initialize batch store using " + comp + ": " +
                            response.getFailureDescription()));
                } else {
                    ModelNode result = response.get(RESULT);
                    ModelNode stepResult = result.get("step-1");
                    if (stepResult.get(RESULT).isDefined()) {
                        batch = stepResult.get(RESULT);
                    }
                    stepResult = result.get("step-2");
                    if (stepResult.get(RESULT).isDefined()) {
                        threadPool = stepResult.get(RESULT);
                    }
                    stepResult = result.get("step-3");
                    if (stepResult.get(RESULT).isDefined()) {
                        jobRepository = stepResult.get(RESULT);
                    }
                    stepResult = result.get("step-4");
                    if (stepResult.get(RESULT).isDefined()) {
                        threadFactories.clear();
                        threadFactories.addAll(stepResult.get(RESULT).asPropertyList());
                    }
                    channel.ack();
                }
            }
        });
    }
1326703
public void start() {
        setStatus(ConnectionStatus.NOT_CONNECTED);
        InetSocketAddress address = directoryServer;
        clientSocket.connect(address);
        eventThread.start();
        connectionThread = new Thread(new ConnectTask());
        connectionThread.setDaemon(true);
        connectionThread.setName(ServiceDirectoryThread.getThreadName("Client_Connect_Thread"));
        connectionThread.start();
    }
472581
public void start(JChannel ch) throws Exception {
        channel=ch;
        channel.setReceiver(this);
        channel.connect("ChatCluster");
        eventLoop();
        channel.close();
    }
505214
@Override
    public void run()
    {
        logger.debug("*******************************************************************************");
        logger.info("***********                    begin dial local to AGI                  ****************");
        logger.debug("***********                                                      ****************");
        logger.debug("*******************************************************************************");
        final AsteriskSettings settings = PBXFactory.getActiveProfile();

        AsteriskPBX pbx = (AsteriskPBX) PBXFactory.getActivePBX();

        final OriginateAction originate = new OriginateAction();
        originate.setEndPoint(from);
        originate.setContext(settings.getManagementContext());
        originate.setExten(pbx.getExtensionAgi());
        originate.setPriority(1);
        originate.setCallerId(fromCallerID);
        originate.setTimeout(30000);

        Map<String, String> myVars = new HashMap<>();

        if (channelVarsToSet != null)
        {
            myVars.putAll(channelVarsToSet);
        }

        originate.setVariables(myVars);

        ActivityArrivalListener listener = new ActivityArrivalListener()
        {

            @Override
            public void channelArrived(Channel channel)
            {
                channels.add(channel);
                if (isSuccess())
                {
                    latch.countDown();
                }
            }
        };
        try (AutoCloseable closeable = ActivityAgi.addArrivalListener(originate, listener);)
        {

            ManagerResponse response = pbx.sendAction(originate, 5000);
            if (response.getResponse().compareToIgnoreCase("Success") != 0)
            {
                callback.progress(this, ActivityStatusEnum.FAILURE, ActivityStatusEnum.FAILURE.getDefaultMessage());
            }
            else
            {
                if (latch.await(5, TimeUnit.SECONDS))
                {
                    callback.progress(this, ActivityStatusEnum.SUCCESS, ActivityStatusEnum.SUCCESS.getDefaultMessage());
                }
                else
                {
                    callback.progress(this, ActivityStatusEnum.FAILURE, ActivityStatusEnum.FAILURE.getDefaultMessage());
                }
            }
        }
        catch (Exception e)
        {
            logger.error(e, e);
            callback.progress(this, ActivityStatusEnum.FAILURE, ActivityStatusEnum.FAILURE.getDefaultMessage());

        }

    }
859937
@Override
    public synchronized void startChain(ChainData chain) throws ChannelException, ChainException {
        String chainName = (null != chain) ? chain.getName() : null;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "startChain: " + chainName);
        }
        if (null == chain) {
            throw new InvalidChainNameException("Null chain");
        }

        // Ensure we have an inbound chain.
        if (FlowType.OUTBOUND.equals(chain.getType())) {
            throw new InvalidChainNameException("Outbound chain cannot use this interface.");
        }

        startChainInternal(chain);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "startChain");
        }
    }