Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultHandler(conn net.Conn) error
- func DialScan(kind string, addr string) (net.Conn, error)
- func Listen(addr string) net.Listener
- func OnHandler(handle Handler, addrs ...string)
- func UnHandler(addrs ...string)
- type CloseFunc
- type ConnSet
- type Handler
- type ListenSet
- type Manager
- type Option
- type Options
- type Server
- type SocketPacket
- func (this *SocketPacket) Cmd() int
- func (this *SocketPacket) Flush() []byte
- func (this *SocketPacket) ReadBegin()
- func (this *SocketPacket) String() string
- func (this *SocketPacket) Sync() bool
- func (this *SocketPacket) With(args ...interface{}) *SocketPacket
- func (this *SocketPacket) WriteBegin() *SocketPacket
- type Stream
- type Symbiote
Constants ¶
View Source
const ( NET_Paylen = 4 NET_Minlen = 4 NET_Maxlen = 1024 * 1024 * 5 )
默认数据
View Source
const ( WEB_LINK = "web" TCP_LINK = "tcp" UDP_LINK = "udp" )
Variables ¶
Functions ¶
func DefaultHandler ¶
Types ¶
type CloseFunc ¶
type CloseFunc func()
*close web func
func StartTcpServer ¶
* quick start tcp server
type Handler ¶
func GetHandler ¶
type Options ¶
func NewOptions ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
* class 用来管理端口(同一监听同一处理方式) * 需要统计
type SocketPacket ¶
* 基础网络包 * msgID: 0表示异步, >0表示同步消息,(必须回传, 不回传会导致客户端阻塞)
func (*SocketPacket) Cmd ¶
func (this *SocketPacket) Cmd() int
func (*SocketPacket) Flush ¶
func (this *SocketPacket) Flush() []byte
func (*SocketPacket) String ¶
func (this *SocketPacket) String() string
func (*SocketPacket) Sync ¶
func (this *SocketPacket) Sync() bool
func (*SocketPacket) With ¶
func (this *SocketPacket) With(args ...interface{}) *SocketPacket
Click to show internal directories.
Click to hide internal directories.