public class DefaultNetSocket extends NetSocket
writeHandlerIDchannel, 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, writeQueueFullclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionHandler, pause, resumeexceptionHandler, setWriteQueueMaxSize, writeQueueFullpublic DefaultNetSocket(VertxInternal vertx, org.jboss.netty.channel.Channel channel, Context context)
public void writeBuffer(Buffer data)
NetSocketWriteStream.writeQueueFull() method before writing. This is done automatically if using a Pump.writeBuffer in interface WriteStreamwriteBuffer in class NetSocketpublic NetSocket write(Buffer data)
NetSocketBuffer to the request body.public NetSocket write(java.lang.String str)
NetSocketString to the connection, encoded in UTF-8.public NetSocket write(java.lang.String str, java.lang.String enc)
NetSocketString to the connection, encoded using the encoding enc.public NetSocket write(Buffer data, Handler<java.lang.Void> doneHandler)
NetSocketBuffer 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)
NetSocketString 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)
NetSocketString 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)
NetSocketdataHandler in interface ReadStreamdataHandler in class NetSocketpublic void endHandler(Handler<java.lang.Void> endHandler)
NetSocketendHandler in interface ReadStreamendHandler in class NetSocketpublic void drainHandler(Handler<java.lang.Void> drainHandler)
NetSocketPump for an example of this being used.drainHandler in interface WriteStreamdrainHandler in class NetSocketpublic void sendFile(java.lang.String filename)
NetSocketfilename 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 ConnectionBaseprotected void handleClosed()
handleClosed in class ConnectionBase