Documentation ¶
Overview ¶
frame protocol
Protocol the interface of protocol, include three method, you can define custom protocol through implement three method.
text protocol.
webSocket protocol
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Frame ¶
type Frame struct { }
Frame frame struct.
type Protocol ¶
type Protocol interface { // Encode encode package before send to client. // The type of return is different for each protocol. Encode(data []byte) interface{} // Decode decode package and emit. Decode(recvBuffer []byte) []byte // Input check the integrity of package. // if return the value of bool, close connection, indicates that the package is greater than MaxPackageSize, // else if return 0, the package is not a integrity package, continue to receive. Input(recvBuffer []byte, maxPackageSize int) interface{} }
Click to show internal directories.
Click to hide internal directories.