public class DefaultNetSocket extends NetSocket
writeHandlerID
channel, closedHandler, context, exceptionHandler, vertx
Constructor and Description |
---|
DefaultNetSocket(VertxInternal vertx,
org.jboss.netty.channel.Channel channel,
Context context) |
Modifier and Type | Method and Description |
---|---|
void |
dataHandler(Handler<Buffer> dataHandler)
Set a data handler.
|
void |
drainHandler(Handler<java.lang.Void> drainHandler)
Set a drain handler on the stream.
|
void |
endHandler(Handler<java.lang.Void> endHandler)
Set an end handler.
|
protected Context |
getContext() |
protected void |
handleClosed() |
void |
sendFile(java.lang.String filename)
Tell the kernel 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. |
NetSocket |
write(Buffer data)
Write a
Buffer to the request body. |
NetSocket |
write(Buffer data,
Handler<java.lang.Void> doneHandler)
Write a
Buffer to the connection. |
NetSocket |
write(java.lang.String str)
Write a
String to the connection, encoded in UTF-8. |
NetSocket |
write(java.lang.String str,
Handler<java.lang.Void> doneHandler)
Write a
String to the connection, encoded in UTF-8. |
NetSocket |
write(java.lang.String str,
java.lang.String enc)
Write a
String to the connection, encoded using the encoding enc . |
NetSocket |
write(java.lang.String str,
java.lang.String enc,
Handler<java.lang.Void> doneHandler)
Write a
String to the connection, encoded with encoding enc . |
void |
writeBuffer(Buffer data)
Write some data to the stream.
|
addFuture, close, closedHandler, exceptionHandler, handleException, handleHandlerException, isSSL, pause, resume, sendFile, setContext, setWriteQueueMaxSize, writeQueueFull
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exceptionHandler, pause, resume
exceptionHandler, setWriteQueueMaxSize, writeQueueFull
public DefaultNetSocket(VertxInternal vertx, org.jboss.netty.channel.Channel channel, Context context)
public void writeBuffer(Buffer data)
NetSocket
WriteStream.writeQueueFull()
method before writing. This is done automatically if using a Pump
.writeBuffer
in interface WriteStream
writeBuffer
in class NetSocket
public NetSocket write(Buffer data)
NetSocket
Buffer
to the request body.public NetSocket write(java.lang.String str)
NetSocket
String
to the connection, encoded in UTF-8.public NetSocket write(java.lang.String str, java.lang.String enc)
NetSocket
String
to the connection, encoded using the encoding enc
.public NetSocket write(Buffer data, Handler<java.lang.Void> doneHandler)
NetSocket
Buffer
to the connection. The doneHandler
is called after the buffer is actually written to the wire.public NetSocket write(java.lang.String str, Handler<java.lang.Void> doneHandler)
NetSocket
String
to the connection, encoded in UTF-8. The doneHandler
is called after the buffer is
actually written to the wire.public NetSocket write(java.lang.String str, java.lang.String enc, Handler<java.lang.Void> doneHandler)
NetSocket
String
to the connection, encoded with encoding enc
. The doneHandler
is called after
the buffer is actually written to the wire.public void dataHandler(Handler<Buffer> dataHandler)
NetSocket
dataHandler
in interface ReadStream
dataHandler
in class NetSocket
public void endHandler(Handler<java.lang.Void> endHandler)
NetSocket
endHandler
in interface ReadStream
endHandler
in class NetSocket
public void drainHandler(Handler<java.lang.Void> drainHandler)
NetSocket
Pump
for an example of this being used.drainHandler
in interface WriteStream
drainHandler
in class NetSocket
public void sendFile(java.lang.String filename)
NetSocket
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.protected Context getContext()
getContext
in class ConnectionBase
protected void handleClosed()
handleClosed
in class ConnectionBase