/** * Creates, initializes and connects socket to the specific * {@link SocketAddress} and returns {@link Connection}, representing socket. * * @param remoteAddress remote address to connect to. * @param completionHandler {@link CompletionHandler}. */ @Override public void connect(SocketAddress remoteAddress, CompletionHandler<Connection> completionHandler) { connectorHandler.connect(remoteAddress, completionHandler); }
protected void connectSync(final SocketAddress remoteAddress, final SocketAddress localAddress, final CompletionHandler<Connection> completionHandler) { final FutureImpl<Connection> future = connectAsync(remoteAddress, localAddress, completionHandler, true); waitNIOFuture(future, completionHandler); }
nioTransport, datagramChannel); preConfigure(newConnection); newConnection.setProcessor(getProcessor()); newConnection.setProcessorSelector(getProcessorSelector()); futureToReturn = makeCancellableFuture(newConnection); completionHandlerToPass = resolveFutureAndCompletionHandler(completionHandler, onlyAddCompletionHandlerToFuture, futureToReturn); } else {
@Override public void connect(final SocketAddress remoteAddress, final SocketAddress localAddress, final CompletionHandler<Connection> completionHandler) { if (!transport.isBlocking()) { connectAsync(remoteAddress, localAddress, completionHandler, false); } else { connectSync(remoteAddress, localAddress, completionHandler); } }
public UDPNIOConnectorHandler build() { UDPNIOConnectorHandler handler = (UDPNIOConnectorHandler) super.build(); if (reuseAddress != null) { handler.setReuseAddress(reuseAddress); } if (timeout != null) { handler.setSyncConnectTimeout(timeout, timeoutTimeunit); } return handler; }
@Override protected AbstractSocketConnectorHandler create() { if (transport == null) { throw new IllegalStateException( "Unable to create UDPNIOConnectorHandler - transport is null"); } return new UDPNIOConnectorHandler(transport); } }
/** * Creates non-connected UDP {@link Connection}. * * @return non-connected UDP {@link Connection}. */ public GrizzlyFuture<Connection> connect() { return connectAsync(null, null, null, true); }
nioTransport, datagramChannel); preConfigure(newConnection); newConnection.setProcessor(getProcessor()); newConnection.setProcessorSelector(getProcessorSelector()); futureToReturn = makeCancellableFuture(newConnection);
@Override public void connect(final SocketAddress remoteAddress, final SocketAddress localAddress, final CompletionHandler<Connection> completionHandler) { if (!transport.isBlocking()) { connectAsync(remoteAddress, localAddress, completionHandler, false); } else { connectSync(remoteAddress, localAddress, completionHandler); } }
public UDPNIOConnectorHandler build() { UDPNIOConnectorHandler handler = (UDPNIOConnectorHandler) super.build(); if (reuseAddress != null) { handler.setReuseAddress(reuseAddress); } if (timeout != null) { handler.setSyncConnectTimeout(timeout, timeoutTimeunit); } return handler; }
@Override protected AbstractSocketConnectorHandler create() { if (transport == null) { throw new IllegalStateException( "Unable to create UDPNIOConnectorHandler - transport is null"); } return new UDPNIOConnectorHandler(transport); } }
/** * Creates non-connected UDP {@link Connection}. * * @return non-connected UDP {@link Connection}. */ public GrizzlyFuture<Connection> connect() { return connectAsync(null, null, null, true); }
nioTransport, datagramChannel); preConfigure(newConnection); newConnection.setProcessor(getProcessor()); newConnection.setProcessorSelector(getProcessorSelector()); futureToReturn = makeCancellableFuture(newConnection);
@Override public void connect(final SocketAddress remoteAddress, final SocketAddress localAddress, final CompletionHandler<Connection> completionHandler) { if (!transport.isBlocking()) { connectAsync(remoteAddress, localAddress, completionHandler, false); } else { connectSync(remoteAddress, localAddress, completionHandler); } }
public UDPNIOConnectorHandler build() { UDPNIOConnectorHandler handler = (UDPNIOConnectorHandler) super.build(); if (reuseAddress != null) { handler.setReuseAddress(reuseAddress); } if (timeout != null) { handler.setSyncConnectTimeout(timeout, timeoutTimeunit); } return handler; }
protected void connectSync(final SocketAddress remoteAddress, final SocketAddress localAddress, final CompletionHandler<Connection> completionHandler) { final FutureImpl<Connection> future = connectAsync(remoteAddress, localAddress, completionHandler, true); waitNIOFuture(future, completionHandler); }
/** * Creates non-connected UDP {@link Connection}. * * @return non-connected UDP {@link Connection}. * @throws java.io.IOException */ public GrizzlyFuture<Connection> connect() throws IOException { return connectorHandler.connect(); }
@Override protected AbstractSocketConnectorHandler create() { if (transport == null) { throw new IllegalStateException( "Unable to create UDPNIOConnectorHandler - transport is null"); } return new UDPNIOConnectorHandler(transport); } }
/** * Creates non-connected UDP {@link Connection}. * * @return non-connected UDP {@link Connection}. */ public GrizzlyFuture<Connection> connect() { return connectAsync(null, null, null, true); }
nioTransport, datagramChannel); preConfigure(newConnection); newConnection.setProcessor(getProcessor()); newConnection.setProcessorSelector(getProcessorSelector()); futureToReturn = makeCancellableFuture(newConnection);