public class WebSocketConnectionImpl extends java.lang.Object implements WebSocketConnection
Modifier and Type | Field and Description |
---|---|
static byte[] |
empty |
static byte |
OPCODE_BINARY |
static byte |
OPCODE_CLOSE |
static byte |
OPCODE_CONT |
static byte |
OPCODE_PING |
static byte |
OPCODE_PONG |
static byte |
OPCODE_TEXT |
Constructor and Description |
---|
WebSocketConnectionImpl(NioWriter writer,
byte[] maskingBytes,
org.jetlang.fibers.NioFiber readFiber,
HttpRequest request) |
Modifier and Type | Method and Description |
---|---|
void |
add(org.jetlang.core.Disposable disposable) |
void |
close()
Attempts to close the underlying socket.
|
void |
closeChannelOnReadThread() |
void |
dispose() |
void |
execute(java.lang.Runnable command) |
static org.jetlang.web.WebSocketConnectionImpl.SizeType |
findSize(int length) |
java.net.SocketAddress |
getRemoteAddress() |
HttpRequest |
getRequest() |
boolean |
remove(org.jetlang.core.Disposable disposable) |
org.jetlang.core.Disposable |
schedule(java.lang.Runnable runnable,
long l,
java.util.concurrent.TimeUnit timeUnit) |
org.jetlang.core.Disposable |
scheduleAtFixedRate(java.lang.Runnable runnable,
long initialDelay,
long delay,
java.util.concurrent.TimeUnit timeUnit) |
org.jetlang.core.Disposable |
scheduleWithFixedDelay(java.lang.Runnable runnable,
long initialDelay,
long delay,
java.util.concurrent.TimeUnit timeUnit) |
SendResult |
send(java.lang.String msg)
Non-Blocking send of a text message.
|
SendResult |
sendBinary(byte[] buffer,
int offset,
int length)
Non-Blocking send of a binary message.
|
SendResult |
sendPing(byte[] bytes,
int offset,
int length)
Non-Blocking send
|
SendResult |
sendPong(byte[] bytes,
int offset,
int length)
Non-Blocking send
|
SendResult |
sendText(byte[] bytes,
int offset,
int length)
Non-Blocking send of a text message.
|
int |
size() |
public static final byte OPCODE_CONT
public static final byte OPCODE_TEXT
public static final byte OPCODE_BINARY
public static final byte OPCODE_CLOSE
public static final byte OPCODE_PING
public static final byte OPCODE_PONG
public static final byte[] empty
public WebSocketConnectionImpl(NioWriter writer, byte[] maskingBytes, org.jetlang.fibers.NioFiber readFiber, HttpRequest request)
public HttpRequest getRequest()
getRequest
in interface WebSocketConnection
public java.net.SocketAddress getRemoteAddress()
getRemoteAddress
in interface WebSocketConnection
public SendResult send(java.lang.String msg)
WebSocketConnection
send
in interface WebSocketConnection
public SendResult sendText(byte[] bytes, int offset, int length)
WebSocketConnection
sendText
in interface WebSocketConnection
public SendResult sendPong(byte[] bytes, int offset, int length)
WebSocketConnection
sendPong
in interface WebSocketConnection
public SendResult sendPing(byte[] bytes, int offset, int length)
WebSocketConnection
sendPing
in interface WebSocketConnection
public SendResult sendBinary(byte[] buffer, int offset, int length)
WebSocketConnection
sendBinary
in interface WebSocketConnection
public static org.jetlang.web.WebSocketConnectionImpl.SizeType findSize(int length)
public void closeChannelOnReadThread()
public void close()
WebSocketConnection
close
in interface WebSocketConnection
public org.jetlang.core.Disposable schedule(java.lang.Runnable runnable, long l, java.util.concurrent.TimeUnit timeUnit)
schedule
in interface org.jetlang.core.Scheduler
public org.jetlang.core.Disposable scheduleWithFixedDelay(java.lang.Runnable runnable, long initialDelay, long delay, java.util.concurrent.TimeUnit timeUnit)
scheduleWithFixedDelay
in interface org.jetlang.core.Scheduler
public org.jetlang.core.Disposable scheduleAtFixedRate(java.lang.Runnable runnable, long initialDelay, long delay, java.util.concurrent.TimeUnit timeUnit)
scheduleAtFixedRate
in interface org.jetlang.core.Scheduler
public void add(org.jetlang.core.Disposable disposable)
add
in interface org.jetlang.core.DisposingExecutor
public boolean remove(org.jetlang.core.Disposable disposable)
remove
in interface org.jetlang.core.DisposingExecutor
public int size()
size
in interface org.jetlang.core.DisposingExecutor
public void execute(java.lang.Runnable command)
execute
in interface java.util.concurrent.Executor
public void dispose()
dispose
in interface org.jetlang.core.Disposable
Copyright © 2019. All Rights Reserved.