Documentation ¶
Index ¶
- func BytesToInt16(buf []byte) int16
- func BytesToInt32(buf []byte) int32
- func BytesToInt64(buf []byte) int64
- func BytesToInt8(buf []byte) int8
- func BytesToUInt16(buf []byte) uint16
- func BytesToUInt32(buf []byte) uint32
- func BytesToUInt64(buf []byte) uint64
- func BytesToUInt8(buf []byte) uint8
- type Config
- type Connection
- func (c *Connection) Close() error
- func (c *Connection) ConnectTime() int64
- func (c *Connection) Fd() int64
- func (c *Connection) Ip() string
- func (c *Connection) IsClosed() bool
- func (c *Connection) ParseHeader()
- func (c *Connection) Read() ([]byte, *Header, error)
- func (c *Connection) Write(buf []byte) (int, error)
- type Event
- type EventInterface
- type Header
- type LenType
- type Server
- type SocketType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToInt16 ¶
func BytesToInt32 ¶
func BytesToInt64 ¶
func BytesToInt8 ¶
func BytesToUInt16 ¶
func BytesToUInt32 ¶
func BytesToUInt64 ¶
func BytesToUInt8 ¶
Types ¶
type Config ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(fd int64, conn net.Conn, c *Config) *Connection
func (*Connection) Close ¶
func (c *Connection) Close() error
func (*Connection) ConnectTime ¶
func (c *Connection) ConnectTime() int64
func (*Connection) Fd ¶
func (c *Connection) Fd() int64
func (*Connection) Ip ¶
func (c *Connection) Ip() string
func (*Connection) IsClosed ¶
func (c *Connection) IsClosed() bool
func (*Connection) ParseHeader ¶
func (c *Connection) ParseHeader()
type EventInterface ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Connection ¶ added in v0.0.2
func (s *Server) Connection(fd int64) *Connection
func (*Server) Connections ¶ added in v0.0.2
func (s *Server) Connections() map[int64]*Connection
func (*Server) SetEvent ¶
func (s *Server) SetEvent(event EventInterface)
type SocketType ¶
type SocketType string
const ( SOCKET_TCP SocketType = "tcp" SOCKET_UDP SocketType = "udp" )
Click to show internal directories.
Click to hide internal directories.