|
|
delegate void | OnConnectHandler (bool success, bool reconnected) |
| |
|
delegate void | OnDisconnectHandler (bool reconnecting) |
| |
|
delegate void | OnMessageHandler (uint ver, uint cmd, string data) |
| |
|
delegate void | OnHeartbeatHandler () |
| |
|
delegate void | OnOfflineHandler () |
| |
|
delegate void | OnResetHandler () |
| |
|
delegate void | OnExceptionHandler (int errCode, string errMessage) |
| |
| | Ws (int hbInterval=5000) |
| | Initializes a new instance of Ws class. More...
|
| |
| void | Update () |
| | Must be called a certain interval from the main thread. For Unity application this must be called in Update. More...
|
| |
| void | SetEncryptionKeys (byte[] sid, byte[] key, byte[] iv, byte[] mackey) |
| | Sets up encryption and decryption of packets. More...
|
| |
| void | SetClientKey (string clientKey) |
| | Sets up client key and send it to the server on connection. More...
|
| |
| bool | IsConnected () |
| | Returns true if WebSocket client is connected to the server. More...
|
| |
| void | Connect (string addr, int port, string uri) |
| | Creates a new WebSocket connection to the server. More...
|
| |
| void | Disconnect () |
| | Closes the WebSocket connection. Raises OnDisconnect event. More...
|
| |
| void | Migrate () |
| | Migrate to a new server node. Useful when handling OnOffline event. OnConnect event with reconnected = true will be raised. The current server session and encryption keys will be securely carried over. More...
|
| |
| void | Reconnect (string addr, int port) |
| | IMPORTANT: This is internal use ONLY. Reconnects to the server. The server MUST be different from the one the client is currently connected to. More...
|
| |
| void | CatchOnReconnect (Action< bool > action, uint ver, uint cmd) |
| | Registers a callback function to be triggered when the client is re-connected and a command response of ver and cmd is returned. Unlike other events, you must use this just before invoking a method that would trigger this event. This event is raised only once. You must call this again if you need this event again. More...
|
| |
| void | Reset () |
| | Remove all event listeners and triggers an even Ws.OnReset. This method MUST be called from the main thread ONLY. More...
|
| |
| void | Send (uint ver, uint cmd, string data) |
| | Sends a byte array message that is JSON encoded to the server. More...
|
| |
|
bool | FindBoolValueByKeyFromJSON (string json, string key) |
| |
|
int | FindNumericValueByKeyFromJSON (string json, string key) |
| |
|
string | FindStringValueByKeyFromJSON (string json, string key) |
| |
|
string | FindObjectValueByKeyFromJSON (string json, string key) |
| |
|
string | FindArrayValueByKeyFromJSON (string json, string key) |
| |
|
string | GetDataFromJSON (string data) |
| |
|
byte[] | GetBytesFromEncodedString (string encoded) |
| |
|
void | Dispose () |
| |
|
|
override void | Dispose (bool disposing) |
| |
|
void | NewTCP (string addr, int port) |
| |
|
void | NewTCPDualMode (string addr, int port) |
| |
|
void | ConnectTCP (string addr, int port) |
| |
|
void | CloseTCP () |
| |
|
NetworkStream | GetTCPStream () |
| |
|
void | SetTCPNoDelay (bool noDelay) |
| |
|
bool | IsTCPConnected () |
| |
|
int | GetTCPAvailable () |
| |
|
void | ConnectUDP (string addr, int port) |
| |
|
void | ConnectUDPDualMode (string addr, int port) |
| |
|
void | CloseUDP () |
| |
|
bool | IsUDPConnected () |
| |
|
bool | UDPPolling (int pollingTime) |
| |
|
int | GetUDPAvailable () |
| |
|
string | FindLocalAddress (IPAddress ip) |
| |
|
int | UDPRcvFrom (byte[] buff, ref EndPoint ep) |
| |
|
void | SendUDP (byte[] msg, int length) |
| |
|
void | SendUDPTo (byte[] msg, int length, IPEndPoint ip) |
| |
|
IPEndPoint | GetRemoteIP () |
| |
|
EndPoint | GetConnetedUDPEndPoint () |
| |
|
IPAddress | GetIPAddress_ (string addr, int port) |
| |