Documentation ¶
Index ¶
- func ByteToString(bytes []byte) string
- func ReadFull(l int, buf []byte) (n int, err error)
- func StringToByte(s string) []byte
- type Client
- type Context
- type EventList
- type ServerConnect
- func (conn *ServerConnect) Close() error
- func (conn *ServerConnect) ReadByte() []byte
- func (conn *ServerConnect) ReadString() string
- func (conn *ServerConnect) Write(data []byte) (n int, err error)
- func (conn *ServerConnect) WriteByteAndClose(data []byte) (writeErr, closeErr error)
- func (conn *ServerConnect) WriteString(data string) (n int, err error)
- func (conn *ServerConnect) WriteStringAndClose(data string) (writeErr, closeErr error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteToString ¶
func StringToByte ¶
Types ¶
type Client ¶
type Client struct { Conn net.Conn Addr string Data chan struct { Body []byte Err error } // contains filtered or unexported fields }
func (*Client) ReadString ¶
客户端读取 返回值为string client read and return string
type Context ¶
type Context struct { Body chan *ServerConnect El *EventList Epoll int SetNonblock bool ConnList map[int]struct{} Lock *sync.RWMutex // contains filtered or unexported fields }
func (*Context) ReadBlock ¶
func (ctx *Context) ReadBlock() chan *ServerConnect
阻塞读取 server block read
func (*Context) ReadServerConnect ¶
func (ctx *Context) ReadServerConnect() *ServerConnect
服务端读取 server read data
type EventList ¶
type EventList struct { Events []unix.EpollEvent // contains filtered or unexported fields }
type ServerConnect ¶
func (*ServerConnect) ReadString ¶
func (conn *ServerConnect) ReadString() string
func (*ServerConnect) Write ¶
func (conn *ServerConnect) Write(data []byte) (n int, err error)
服务端写入 []byte server write []byte
func (*ServerConnect) WriteByteAndClose ¶
func (conn *ServerConnect) WriteByteAndClose(data []byte) (writeErr, closeErr error)
服务端写入[]byte并且断开连接 server write []byte and close conn
func (*ServerConnect) WriteString ¶
func (conn *ServerConnect) WriteString(data string) (n int, err error)
服务端写入 string server write string
func (*ServerConnect) WriteStringAndClose ¶
func (conn *ServerConnect) WriteStringAndClose(data string) (writeErr, closeErr error)
服务端写入string并且断开连接 server write string and close conn
Click to show internal directories.
Click to hide internal directories.