| 1 | package io.socket.parser; |
| 2 | |
| 3 | public interface Parser { |
| 4 | |
| 5 | /** |
| 6 | * Packet type `connect`. |
| 7 | */ |
| 8 | int CONNECT = 0; |
| 9 | |
| 10 | /** |
| 11 | * Packet type `disconnect`. |
| 12 | */ |
| 13 | int DISCONNECT = 1; |
| 14 | |
| 15 | /** |
| 16 | * Packet type `event`. |
| 17 | */ |
| 18 | int EVENT = 2; |
| 19 | |
| 20 | /** |
| 21 | * Packet type `ack`. |
| 22 | */ |
| 23 | int ACK = 3; |
| 24 | |
| 25 | /** |
| 26 | * Packet type `error`. |
| 27 | */ |
| 28 | int CONNECT_ERROR = 4; |
| 29 | |
| 30 | /** |
| 31 | * Packet type `binary event`. |
| 32 | */ |
| 33 | int BINARY_EVENT = 5; |
| 34 | |
| 35 | /** |
| 36 | * Packet type `binary ack`. |
| 37 | */ |
| 38 | int BINARY_ACK = 6; |
| 39 | |
| 40 | int protocol = 5; |
| 41 | |
| 42 | /** |
| 43 | * Packet types. |
| 44 | */ |
| 45 | String[] types = new String[] { |
| 46 | "CONNECT", |
| 47 | "DISCONNECT", |
| 48 | "EVENT", |
| 49 | "ACK", |
| 50 | "ERROR", |
| 51 | "BINARY_EVENT", |
| 52 | "BINARY_ACK" |
| 53 | }; |
| 54 | |
| 55 | interface Encoder { |
| 56 | |
| 57 | void encode(Packet obj, Callback callback); |
| 58 | |
| 59 | interface Callback { |
| 60 |
nothing calls this directly
no outgoing calls
no test coverage detected