|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.nkzawa.emitter.Emitter
com.github.nkzawa.engineio.client.Socket
public class Socket
The socket class for Event.IO Client.
| Nested Class Summary | |
|---|---|
static class |
Socket.Options
|
| Nested classes/interfaces inherited from class com.github.nkzawa.emitter.Emitter |
|---|
Emitter.Listener |
| Field Summary | |
|---|---|
static String |
EVENT_CLOSE
Called on disconnection. |
static String |
EVENT_DATA
|
static String |
EVENT_DRAIN
Called after `drain` event of transport if writeBuffer is empty. |
static String |
EVENT_ERROR
Called when an error occurs. |
static String |
EVENT_FLUSH
Called on completing a buffer flush. |
static String |
EVENT_HANDSHAKE
|
static String |
EVENT_HEARTBEAT
|
static String |
EVENT_MESSAGE
Called when data is received from the server. |
static String |
EVENT_OPEN
Called on successful connection. |
static String |
EVENT_PACKET
|
static String |
EVENT_PACKET_CREATE
|
static String |
EVENT_TRANSPORT
Called on a new transport is created. |
static String |
EVENT_UPGRADE
|
static String |
EVENT_UPGRADE_ERROR
|
static String |
EVENT_UPGRADING
|
static boolean |
priorWebsocketSuccess
|
static int |
protocol
The protocol version. |
| Constructor Summary | |
|---|---|
Socket()
|
|
Socket(Socket.Options opts)
|
|
Socket(String uri)
Creates a socket. |
|
Socket(String uri,
Socket.Options opts)
Creates a socket with options. |
|
Socket(URI uri)
|
|
Socket(URI uri,
Socket.Options opts)
|
|
| Method Summary | |
|---|---|
Socket |
close()
Disconnects the client. |
Socket |
open()
Connects the client. |
void |
ping()
Sends a ping packet. |
void |
send(byte[] msg)
|
void |
send(byte[] msg,
Runnable fn)
|
void |
send(String msg)
Sends a message. |
void |
send(String msg,
Runnable fn)
Sends a message. |
static void |
setDefaultSSLContext(SSLContext sslContext)
|
void |
write(byte[] msg)
|
void |
write(byte[] msg,
Runnable fn)
|
void |
write(String msg)
|
void |
write(String msg,
Runnable fn)
|
| Methods inherited from class com.github.nkzawa.emitter.Emitter |
|---|
emit, hasListeners, listeners, off, off, off, on, once |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String EVENT_OPEN
public static final String EVENT_CLOSE
public static final String EVENT_MESSAGE
public static final String EVENT_ERROR
public static final String EVENT_UPGRADE_ERROR
public static final String EVENT_FLUSH
public static final String EVENT_DRAIN
public static final String EVENT_HANDSHAKE
public static final String EVENT_UPGRADING
public static final String EVENT_UPGRADE
public static final String EVENT_PACKET
public static final String EVENT_PACKET_CREATE
public static final String EVENT_HEARTBEAT
public static final String EVENT_DATA
public static final String EVENT_TRANSPORT
public static final int protocol
public static boolean priorWebsocketSuccess
| Constructor Detail |
|---|
public Socket()
public Socket(String uri)
throws URISyntaxException
uri - URI to connect.
URISyntaxExceptionpublic Socket(URI uri)
public Socket(String uri,
Socket.Options opts)
throws URISyntaxException
uri - URI to connect.opts - options for socket
URISyntaxException
public Socket(URI uri,
Socket.Options opts)
public Socket(Socket.Options opts)
| Method Detail |
|---|
public static void setDefaultSSLContext(SSLContext sslContext)
public Socket open()
public void ping()
public void write(String msg)
public void write(String msg,
Runnable fn)
public void write(byte[] msg)
public void write(byte[] msg,
Runnable fn)
public void send(String msg)
msg - public void send(byte[] msg)
public void send(String msg,
Runnable fn)
msg - fn - callback to be called on drain
public void send(byte[] msg,
Runnable fn)
public Socket close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||