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 @see \io\vertx\jphp\core\net\NetClient when a connection to a server is made, or on the server side by a @see \io\vertx\jphp\core\net\NetServer when a server accepts a connection.
It implements both and so it can be used with
see |
to pump data with flow control. |
---|---|
package |
Default |
__construct()
close() : void
closeHandler( $arg0) : $this
callable
$this
a reference to this, so the API can be used fluently
drainHandler( $arg0) : $this
callable
$this
end( $arg0 = null) : void
end()
Same as @see \io\vertx\jphp\core\net\NetSocket::end but writes some data to the stream before ending.
param $t [Buffer] end($t)
Buffer
endHandler( $arg0) : $this
callable
$this
exceptionHandler( $arg0) : $this
callable
$this
fetch( $arg0) : $this
integer
$this
handler( $arg0) : $this
callable
$this
indicatedServerName() : string
string
the indicated server name
isSsl() : boolean
boolean
true if this {@link io.vertx.core.net.NetSocket} is encrypted via SSL/TLS.
localAddress() : \io\vertx\jphp\core\net\SocketAddress
pause() : $this
$this
remoteAddress() : \io\vertx\jphp\core\net\SocketAddress
resume() : $this
$this
sendFile( $arg0, $arg1 = null, $arg2 = null, $arg3 = null) : $this
param $filename [string] file name of the file to send sendFile($filename)
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.
param $filename [string] file name of the file to send param $offset [integer] offset sendFile($filename, $offset)
Same as @see \io\vertx\jphp\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 [string] file name of the file to send param $resultHandler [callable] handler sendFile($filename, $resultHandler)
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.
param $filename [string] file name of the file to send param $offset [integer] offset param $length [integer] length sendFile($filename, $offset, $length)
Same as @see \io\vertx\jphp\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 [string] file name of the file to send param $offset [integer] offset param $resultHandler [callable] handler sendFile($filename, $offset, $resultHandler)
Same as @see \io\vertx\jphp\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 [string] file name of the file to send param $offset [integer] offset param $length [integer] length param $resultHandler [callable] handler sendFile($filename, $offset, $length, $resultHandler)
string
callable | integer
callable | integer
callable
$this
a reference to this, so the API can be used fluently
setWriteQueueMaxSize( $arg0) : $this
integer
$this
upgradeToSsl( $arg0, $arg1 = null) : $this
param $handler [callable] the handler will be notified when it's upgraded upgradeToSsl($handler)
Upgrade channel to use SSL/TLS. Be aware that for this to work SSL must be configured.
param $serverName [string] the server name param $handler [callable] the handler will be notified when it's upgraded upgradeToSsl($serverName, $handler)
callable | string
callable
$this
a reference to this, so the API can be used fluently
write( $arg0, $arg1 = null) : $this
Write a \java.lang.String to the connection, encoded in UTF-8.
param $str [string] the string to write write($str)
Write a \java.lang.String to the connection, encoded using the encoding enc
.
param $str [string] the string to write param $enc [string] the encoding to use write($str, $enc)
Like but with an handler
called when the message has been written
or failed to be written.
param $message [Buffer] param $handler [callable] write($message, $handler)
Buffer | string
callable | string
$this
writeHandlerID() : string
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.
string
the write handler ID
writeQueueFull() : boolean
boolean
true if write queue is full