/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.reactivex.core.net;
import java.util.Map;
import io.reactivex.Observable;
import io.reactivex.Flowable;
import io.reactivex.Single;
import io.reactivex.Completable;
import io.reactivex.Maybe;
import javax.net.ssl.SSLSession;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
Represents a socket-like interface to a TCP connection on either the
client or the server side.
Instances of this class are created on the client side by an NetClient
when a connection to a server is made, or on the server side by a NetServer
when a server accepts a connection.
It implements both and so it can be used with Pump
to pump data with flow control.
NOTE: This class has been automatically generated from the original
non RX-ified interface using Vert.x codegen. /**
* Represents a socket-like interface to a TCP connection on either the
* client or the server side.
* <p>
* Instances of this class are created on the client side by an {@link io.vertx.reactivex.core.net.NetClient}
* when a connection to a server is made, or on the server side by a {@link io.vertx.reactivex.core.net.NetServer}
* when a server accepts a connection.
* <p>
* It implements both and so it can be used with
* {@link io.vertx.reactivex.core.streams.Pump} to pump data with flow control.
*
* <p/>
* NOTE: This class has been automatically generated from the {@link io.vertx.core.net.NetSocket original} non RX-ified interface using Vert.x codegen.
*/
@io.vertx.lang.rx.RxGen(io.vertx.core.net.NetSocket.class)
public class NetSocket implements io.vertx.reactivex.core.streams.ReadStream<io.vertx.reactivex.core.buffer.Buffer>, io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.core.buffer.Buffer> {
@Override
public String toString() {
return delegate.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NetSocket that = (NetSocket) o;
return delegate.equals(that.delegate);
}
@Override
public int hashCode() {
return delegate.hashCode();
}
public static final io.vertx.lang.rx.TypeArg<NetSocket> __TYPE_ARG = new io.vertx.lang.rx.TypeArg<>( obj -> new NetSocket((io.vertx.core.net.NetSocket) obj),
NetSocket::getDelegate
);
private final io.vertx.core.net.NetSocket delegate;
public NetSocket(io.vertx.core.net.NetSocket delegate) {
this.delegate = delegate;
}
public io.vertx.core.net.NetSocket getDelegate() {
return delegate;
}
private io.reactivex.Observable<io.vertx.reactivex.core.buffer.Buffer> observable;
private io.reactivex.Flowable<io.vertx.reactivex.core.buffer.Buffer> flowable;
public synchronized io.reactivex.Observable<io.vertx.reactivex.core.buffer.Buffer> toObservable() {
if (observable == null) {
java.util.function.Function<io.vertx.core.buffer.Buffer, io.vertx.reactivex.core.buffer.Buffer> conv = io.vertx.reactivex.core.buffer.Buffer::newInstance;
observable = io.vertx.reactivex.ObservableHelper.toObservable(delegate, conv);
}
return observable;
}
public synchronized io.reactivex.Flowable<io.vertx.reactivex.core.buffer.Buffer> toFlowable() {
if (flowable == null) {
java.util.function.Function<io.vertx.core.buffer.Buffer, io.vertx.reactivex.core.buffer.Buffer> conv = io.vertx.reactivex.core.buffer.Buffer::newInstance;
flowable = io.vertx.reactivex.FlowableHelper.toFlowable(delegate, conv);
}
return flowable;
}
private io.vertx.reactivex.WriteStreamObserver<io.vertx.reactivex.core.buffer.Buffer> observer;
private io.vertx.reactivex.WriteStreamSubscriber<io.vertx.reactivex.core.buffer.Buffer> subscriber;
public synchronized io.vertx.reactivex.WriteStreamObserver<io.vertx.reactivex.core.buffer.Buffer> toObserver() {
if (observer == null) {
java.util.function.Function<io.vertx.reactivex.core.buffer.Buffer, io.vertx.core.buffer.Buffer> conv = io.vertx.reactivex.core.buffer.Buffer::getDelegate;
observer = io.vertx.reactivex.RxHelper.toObserver(getDelegate(), conv);
}
return observer;
}
public synchronized io.vertx.reactivex.WriteStreamSubscriber<io.vertx.reactivex.core.buffer.Buffer> toSubscriber() {
if (subscriber == null) {
java.util.function.Function<io.vertx.reactivex.core.buffer.Buffer, io.vertx.core.buffer.Buffer> conv = io.vertx.reactivex.core.buffer.Buffer::getDelegate;
subscriber = io.vertx.reactivex.RxHelper.toSubscriber(getDelegate(), conv);
}
return subscriber;
}
Same as end
but writes some data to the stream before ending. Params: - data – the data to write
/**
* Same as {@link io.vertx.reactivex.core.net.NetSocket#end} but writes some data to the stream before ending.
* @param data the data to write
*/
public void end(io.vertx.reactivex.core.buffer.Buffer data) {
delegate.end(data.getDelegate());
}
Same as but with an handler
called when the operation completes
Params: - data –
- handler –
/**
* Same as but with an <code>handler</code> called when the operation completes
* @param data
* @param handler
*/
public void end(io.vertx.reactivex.core.buffer.Buffer data, Handler<AsyncResult<Void>> handler) {
delegate.end(data.getDelegate(), handler);
}
Same as but with an handler
called when the operation completes
Params: - data –
Returns:
/**
* Same as but with an <code>handler</code> called when the operation completes
* @param data
* @return
*/
public Completable rxEnd(io.vertx.reactivex.core.buffer.Buffer data) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
end(data, handler);
});
}
This will return true
if there are more bytes in the write queue than the value set using setWriteQueueMaxSize
Returns: true if write queue is full
/**
* This will return <code>true</code> if there are more bytes in the write queue than the value set using {@link io.vertx.reactivex.core.net.NetSocket#setWriteQueueMaxSize}
* @return true if write queue is full
*/
public boolean writeQueueFull() {
boolean ret = delegate.writeQueueFull();
return ret;
}
Pause this stream and return a to transfer the elements of this stream to a destination .
The stream will be resumed when the pipe will be wired to a WriteStream
.
Returns: a pipe
/**
* Pause this stream and return a to transfer the elements of this stream to a destination .
* <p/>
* The stream will be resumed when the pipe will be wired to a <code>WriteStream</code>.
* @return a pipe
*/
public io.vertx.reactivex.core.streams.Pipe<io.vertx.reactivex.core.buffer.Buffer> pipe() {
io.vertx.reactivex.core.streams.Pipe<io.vertx.reactivex.core.buffer.Buffer> ret = io.vertx.reactivex.core.streams.Pipe.newInstance(delegate.pipe(), (io.vertx.lang.rx.TypeArg)io.vertx.reactivex.core.buffer.Buffer.__TYPE_ARG);
return ret;
}
Like ReadStream.pipeTo
but with no completion handler. Params: - dst –
/**
* Like {@link io.vertx.reactivex.core.streams.ReadStream#pipeTo} but with no completion handler.
* @param dst
*/
public void pipeTo(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.core.buffer.Buffer> dst) {
delegate.pipeTo(dst.getDelegate());
}
Pipe this ReadStream
to the WriteStream
.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler
will be
called with the result.
Params: - dst – the destination write stream
- handler –
/**
* Pipe this <code>ReadStream</code> to the <code>WriteStream</code>.
* <p>
* Elements emitted by this stream will be written to the write stream until this stream ends or fails.
* <p>
* Once this stream has ended or failed, the write stream will be ended and the <code>handler</code> will be
* called with the result.
* @param dst the destination write stream
* @param handler
*/
public void pipeTo(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.core.buffer.Buffer> dst, Handler<AsyncResult<Void>> handler) {
delegate.pipeTo(dst.getDelegate(), handler);
}
Pipe this ReadStream
to the WriteStream
.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler
will be
called with the result.
Params: - dst – the destination write stream
Returns:
/**
* Pipe this <code>ReadStream</code> to the <code>WriteStream</code>.
* <p>
* Elements emitted by this stream will be written to the write stream until this stream ends or fails.
* <p>
* Once this stream has ended or failed, the write stream will be ended and the <code>handler</code> will be
* called with the result.
* @param dst the destination write stream
* @return
*/
public Completable rxPipeTo(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.core.buffer.Buffer> dst) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
pipeTo(dst, handler);
});
}
public io.vertx.reactivex.core.net.NetSocket exceptionHandler(Handler<Throwable> handler) {
delegate.exceptionHandler(handler);
return this;
}
public io.vertx.reactivex.core.net.NetSocket handler(Handler<io.vertx.reactivex.core.buffer.Buffer> handler) {
delegate.handler(new Handler<io.vertx.core.buffer.Buffer>() {
public void handle(io.vertx.core.buffer.Buffer event) {
handler.handle(io.vertx.reactivex.core.buffer.Buffer.newInstance(event));
}
});
return this;
}
public io.vertx.reactivex.core.net.NetSocket pause() {
delegate.pause();
return this;
}
public io.vertx.reactivex.core.net.NetSocket resume() {
delegate.resume();
return this;
}
public io.vertx.reactivex.core.net.NetSocket fetch(long amount) {
delegate.fetch(amount);
return this;
}
This handler might be called after the close handler when the socket is paused and there are still
buffers to deliver.
Params: - endHandler –
Returns:
/**
*
* <p>
* This handler might be called after the close handler when the socket is paused and there are still
* buffers to deliver.
* @param endHandler
* @return
*/
public io.vertx.reactivex.core.net.NetSocket endHandler(Handler<Void> endHandler) {
delegate.endHandler(endHandler);
return this;
}
public io.vertx.reactivex.core.net.NetSocket write(io.vertx.reactivex.core.buffer.Buffer data) {
delegate.write(data.getDelegate());
return this;
}
public io.vertx.reactivex.core.net.NetSocket setWriteQueueMaxSize(int maxSize) {
delegate.setWriteQueueMaxSize(maxSize);
return this;
}
public io.vertx.reactivex.core.net.NetSocket drainHandler(Handler<Void> handler) {
delegate.drainHandler(handler);
return this;
}
When a NetSocket
is created it automatically registers an event handler with the event bus, the ID of that
handler is given by writeHandlerID
.
Given this ID, a different event loop can send a buffer to that event handler using the event bus and
that buffer will be received by this instance in its own event loop and written to the underlying connection. This
allows you to write data to other connections which are owned by different event loops.
Returns: the write handler ID
/**
* When a <code>NetSocket</code> is created it automatically registers an event handler with the event bus, the ID of that
* handler is given by <code>writeHandlerID</code>.
* <p>
* Given this ID, a different event loop can send a buffer to that event handler using the event bus and
* that buffer will be received by this instance in its own event loop and written to the underlying connection. This
* allows you to write data to other connections which are owned by different event loops.
* @return the write handler ID
*/
public String writeHandlerID() {
String ret = delegate.writeHandlerID();
return ret;
}
Same as write
but with an handler
called when the operation completes
Params: - str –
- handler –
Returns:
/**
* Same as {@link io.vertx.reactivex.core.net.NetSocket#write} but with an <code>handler</code> called when the operation completes
* @param str
* @param handler
* @return
*/
public io.vertx.reactivex.core.net.NetSocket write(String str, Handler<AsyncResult<Void>> handler) {
delegate.write(str, handler);
return this;
}
Same as write
but with an handler
called when the operation completes
Params: - str –
Returns:
/**
* Same as {@link io.vertx.reactivex.core.net.NetSocket#write} but with an <code>handler</code> called when the operation completes
* @param str
* @return
*/
public Completable rxWrite(String str) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
write(str, handler);
});
}
Write a String
to the connection, encoded in UTF-8. Params: - str – the string to write
Returns: a reference to this, so the API can be used fluently
/**
* Write a {@link java.lang.String} to the connection, encoded in UTF-8.
* @param str the string to write
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.reactivex.core.net.NetSocket write(String str) {
delegate.write(str);
return this;
}
Same as write
but with an handler
called when the operation completes
Params: - str –
- enc –
- handler –
Returns:
/**
* Same as {@link io.vertx.reactivex.core.net.NetSocket#write} but with an <code>handler</code> called when the operation completes
* @param str
* @param enc
* @param handler
* @return
*/
public io.vertx.reactivex.core.net.NetSocket write(String str, String enc, Handler<AsyncResult<Void>> handler) {
delegate.write(str, enc, handler);
return this;
}
Same as write
but with an handler
called when the operation completes
Params: - str –
- enc –
Returns:
/**
* Same as {@link io.vertx.reactivex.core.net.NetSocket#write} but with an <code>handler</code> called when the operation completes
* @param str
* @param enc
* @return
*/
public Completable rxWrite(String str, String enc) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
write(str, enc, handler);
});
}
Write a String
to the connection, encoded using the encoding enc
.
Params: - str – the string to write
- enc – the encoding to use
Returns: a reference to this, so the API can be used fluently
/**
* Write a {@link java.lang.String} to the connection, encoded using the encoding <code>enc</code>.
* @param str the string to write
* @param enc the encoding to use
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.reactivex.core.net.NetSocket write(String str, String enc) {
delegate.write(str, enc);
return this;
}
Like but with an handler
called when the message has been written
or failed to be written.
Params: - message –
- handler –
Returns:
/**
* Like but with an <code>handler</code> called when the message has been written
* or failed to be written.
* @param message
* @param handler
* @return
*/
public io.vertx.reactivex.core.net.NetSocket write(io.vertx.reactivex.core.buffer.Buffer message, Handler<AsyncResult<Void>> handler) {
delegate.write(message.getDelegate(), handler);
return this;
}
Like but with an handler
called when the message has been written
or failed to be written.
Params: - message –
Returns:
/**
* Like but with an <code>handler</code> called when the message has been written
* or failed to be written.
* @param message
* @return
*/
public Completable rxWrite(io.vertx.reactivex.core.buffer.Buffer message) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
write(message, handler);
});
}
Tell the operating system to stream a file as specified by filename
directly from disk to the outgoing connection,
bypassing userspace altogether (where supported by the underlying operating system. This is a very efficient way to stream files.
Params: - filename – file name of the file to send
Returns: a reference to this, so the API can be used fluently
/**
* Tell the operating system to stream a file as specified by <code>filename</code> directly from disk to the outgoing connection,
* bypassing userspace altogether (where supported by the underlying operating system. This is a very efficient way to stream files.
* @param filename file name of the file to send
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.reactivex.core.net.NetSocket sendFile(String filename) {
delegate.sendFile(filename);
return this;
}
Tell the operating system to stream a file as specified by filename
directly from disk to the outgoing connection,
bypassing userspace altogether (where supported by the underlying operating system. This is a very efficient way to stream files.
Params: - filename – file name of the file to send
- offset – offset
Returns: a reference to this, so the API can be used fluently
/**
* Tell the operating system to stream a file as specified by <code>filename</code> directly from disk to the outgoing connection,
* bypassing userspace altogether (where supported by the underlying operating system. This is a very efficient way to stream files.
* @param filename file name of the file to send
* @param offset offset
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.reactivex.core.net.NetSocket sendFile(String filename, long offset) {
delegate.sendFile(filename, offset);
return this;
}
Tell the operating system to stream a file as specified by filename
directly from disk to the outgoing connection,
bypassing userspace altogether (where supported by the underlying operating system. This is a very efficient way to stream files.
Params: - filename – file name of the file to send
- offset – offset
- length – length
Returns: a reference to this, so the API can be used fluently
/**
* Tell the operating system to stream a file as specified by <code>filename</code> directly from disk to the outgoing connection,
* bypassing userspace altogether (where supported by the underlying operating system. This is a very efficient way to stream files.
* @param filename file name of the file to send
* @param offset offset
* @param length length
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.reactivex.core.net.NetSocket sendFile(String filename, long offset, long length) {
delegate.sendFile(filename, offset, length);
return this;
}
Same as sendFile
but also takes a handler that will be called when the send has completed or a failure has occurred Params: - filename – file name of the file to send
- resultHandler – handler
Returns: a reference to this, so the API can be used fluently
/**
* Same as {@link io.vertx.reactivex.core.net.NetSocket#sendFile} but also takes a handler that will be called when the send has completed or
* a failure has occurred
* @param filename file name of the file to send
* @param resultHandler handler
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.reactivex.core.net.NetSocket sendFile(String filename, Handler<AsyncResult<Void>> resultHandler) {
delegate.sendFile(filename, resultHandler);
return this;
}
Same as sendFile
but also takes a handler that will be called when the send has completed or a failure has occurred Params: - filename – file name of the file to send
Returns: a reference to this, so the API can be used fluently
/**
* Same as {@link io.vertx.reactivex.core.net.NetSocket#sendFile} but also takes a handler that will be called when the send has completed or
* a failure has occurred
* @param filename file name of the file to send
* @return a reference to this, so the API can be used fluently
*/
public Completable rxSendFile(String filename) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
sendFile(filename, handler);
});
}
Same as sendFile
but also takes a handler that will be called when the send has completed or a failure has occurred Params: - filename – file name of the file to send
- offset – offset
- resultHandler – handler
Returns: a reference to this, so the API can be used fluently
/**
* Same as {@link io.vertx.reactivex.core.net.NetSocket#sendFile} but also takes a handler that will be called when the send has completed or
* a failure has occurred
* @param filename file name of the file to send
* @param offset offset
* @param resultHandler handler
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.reactivex.core.net.NetSocket sendFile(String filename, long offset, Handler<AsyncResult<Void>> resultHandler) {
delegate.sendFile(filename, offset, resultHandler);
return this;
}
Same as sendFile
but also takes a handler that will be called when the send has completed or a failure has occurred Params: - filename – file name of the file to send
- offset – offset
Returns: a reference to this, so the API can be used fluently
/**
* Same as {@link io.vertx.reactivex.core.net.NetSocket#sendFile} but also takes a handler that will be called when the send has completed or
* a failure has occurred
* @param filename file name of the file to send
* @param offset offset
* @return a reference to this, so the API can be used fluently
*/
public Completable rxSendFile(String filename, long offset) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
sendFile(filename, offset, handler);
});
}
Same as sendFile
but also takes a handler that will be called when the send has completed or a failure has occurred Params: - filename – file name of the file to send
- offset – offset
- length – length
- resultHandler – handler
Returns: a reference to this, so the API can be used fluently
/**
* Same as {@link io.vertx.reactivex.core.net.NetSocket#sendFile} but also takes a handler that will be called when the send has completed or
* a failure has occurred
* @param filename file name of the file to send
* @param offset offset
* @param length length
* @param resultHandler handler
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.reactivex.core.net.NetSocket sendFile(String filename, long offset, long length, Handler<AsyncResult<Void>> resultHandler) {
delegate.sendFile(filename, offset, length, resultHandler);
return this;
}
Same as sendFile
but also takes a handler that will be called when the send has completed or a failure has occurred Params: - filename – file name of the file to send
- offset – offset
- length – length
Returns: a reference to this, so the API can be used fluently
/**
* Same as {@link io.vertx.reactivex.core.net.NetSocket#sendFile} but also takes a handler that will be called when the send has completed or
* a failure has occurred
* @param filename file name of the file to send
* @param offset offset
* @param length length
* @return a reference to this, so the API can be used fluently
*/
public Completable rxSendFile(String filename, long offset, long length) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
sendFile(filename, offset, length, handler);
});
}
Returns: the remote address for this socket
/**
* @return the remote address for this socket
*/
public io.vertx.reactivex.core.net.SocketAddress remoteAddress() {
if (cached_0 != null) {
return cached_0;
}
io.vertx.reactivex.core.net.SocketAddress ret = io.vertx.reactivex.core.net.SocketAddress.newInstance(delegate.remoteAddress());
cached_0 = ret;
return ret;
}
Returns: the local address for this socket
/**
* @return the local address for this socket
*/
public io.vertx.reactivex.core.net.SocketAddress localAddress() {
if (cached_1 != null) {
return cached_1;
}
io.vertx.reactivex.core.net.SocketAddress ret = io.vertx.reactivex.core.net.SocketAddress.newInstance(delegate.localAddress());
cached_1 = ret;
return ret;
}
Calls close
/**
* Calls {@link io.vertx.reactivex.core.net.NetSocket#close}
*/
public void end() {
delegate.end();
}
Calls end
Params: - handler –
/**
* Calls {@link io.vertx.reactivex.core.net.NetSocket#end}
* @param handler
*/
public void end(Handler<AsyncResult<Void>> handler) {
delegate.end(handler);
}
Calls end
Returns:
/**
* Calls {@link io.vertx.reactivex.core.net.NetSocket#end}
* @return
*/
public Completable rxEnd() {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
end(handler);
});
}
Close the NetSocket
/**
* Close the NetSocket
*/
public void close() {
delegate.close();
}
Close the NetSocket and notify the handler
when the operation completes.
Params: - handler –
/**
* Close the NetSocket and notify the <code>handler</code> when the operation completes.
* @param handler
*/
public void close(Handler<AsyncResult<Void>> handler) {
delegate.close(handler);
}
Close the NetSocket and notify the handler
when the operation completes.
Returns:
/**
* Close the NetSocket and notify the <code>handler</code> when the operation completes.
* @return
*/
public Completable rxClose() {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
close(handler);
});
}
Set a handler that will be called when the NetSocket is closed
Params: - handler – the handler
Returns: a reference to this, so the API can be used fluently
/**
* Set a handler that will be called when the NetSocket is closed
* @param handler the handler
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.reactivex.core.net.NetSocket closeHandler(Handler<Void> handler) {
delegate.closeHandler(handler);
return this;
}
Upgrade channel to use SSL/TLS. Be aware that for this to work SSL must be configured.
Params: - handler – the handler will be notified when it's upgraded
Returns: a reference to this, so the API can be used fluently
/**
* Upgrade channel to use SSL/TLS. Be aware that for this to work SSL must be configured.
* @param handler the handler will be notified when it's upgraded
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.reactivex.core.net.NetSocket upgradeToSsl(Handler<Void> handler) {
delegate.upgradeToSsl(handler);
return this;
}
Upgrade channel to use SSL/TLS. Be aware that for this to work SSL must be configured.
Params: - serverName – the server name
- handler – the handler will be notified when it's upgraded
Returns: a reference to this, so the API can be used fluently
/**
* Upgrade channel to use SSL/TLS. Be aware that for this to work SSL must be configured.
* @param serverName the server name
* @param handler the handler will be notified when it's upgraded
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.reactivex.core.net.NetSocket upgradeToSsl(String serverName, Handler<Void> handler) {
delegate.upgradeToSsl(serverName, handler);
return this;
}
Returns: true if this NetSocket
is encrypted via SSL/TLS.
/**
* @return true if this {@link io.vertx.reactivex.core.net.NetSocket} is encrypted via SSL/TLS.
*/
public boolean isSsl() {
boolean ret = delegate.isSsl();
return ret;
}
Returns the SNI server name presented during the SSL handshake by the client.
Returns: the indicated server name
/**
* Returns the SNI server name presented during the SSL handshake by the client.
* @return the indicated server name
*/
public String indicatedServerName() {
String ret = delegate.indicatedServerName();
return ret;
}
Returns: SSLSession associated with the underlying socket. Returns null if connection is not SSL.
/**
* @return SSLSession associated with the underlying socket. Returns null if connection is not SSL.
*/
public SSLSession sslSession() {
SSLSession ret = delegate.sslSession();
return ret;
}
private io.vertx.reactivex.core.net.SocketAddress cached_0;
private io.vertx.reactivex.core.net.SocketAddress cached_1;
public static NetSocket newInstance(io.vertx.core.net.NetSocket arg) {
return arg != null ? new NetSocket(arg) : null;
}
}