Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (p *Client) Accept() error
- func (p *Client) AcceptDirectTcpConn(conn *net.TCPConn, targetAddr string)
- func (p *Client) AcceptSock5Conn(conn *net.TCPConn)
- func (p *Client) AcceptTcp() error
- func (p *Client) AcceptTcpConn(conn *net.TCPConn, targetAddr string)
- func (p *Client) Addr() string
- func (p *Client) IPAddr() *net.UDPAddr
- func (p *Client) LocalAddrToConnMapSize() int
- func (p *Client) LocalIdToConnMapSize() int
- func (p *Client) RTT() time.Duration
- func (p *Client) RecvPacket() uint64
- func (p *Client) RecvPacketSize() uint64
- func (p *Client) Run() error
- func (p *Client) SendPacket() uint64
- func (p *Client) SendPacketSize() uint64
- func (p *Client) ServerAddr() string
- func (p *Client) ServerIPAddr() *net.IPAddr
- func (p *Client) Stop()
- func (p *Client) TargetAddr() string
- type ClientConn
- type MyMsg
- func (*MyMsg) Descriptor() ([]byte, []int)
- func (m *MyMsg) GetData() []byte
- func (m *MyMsg) GetId() string
- func (m *MyMsg) GetKey() int32
- func (m *MyMsg) GetMagic() int32
- func (m *MyMsg) GetRproto() int32
- func (m *MyMsg) GetTarget() string
- func (m *MyMsg) GetTcpmode() int32
- func (m *MyMsg) GetTcpmodeBuffersize() int32
- func (m *MyMsg) GetTcpmodeCompress() int32
- func (m *MyMsg) GetTcpmodeMaxwin() int32
- func (m *MyMsg) GetTcpmodeResendTimems() int32
- func (m *MyMsg) GetTcpmodeStat() int32
- func (m *MyMsg) GetTimeout() int32
- func (m *MyMsg) GetType() int32
- func (*MyMsg) ProtoMessage()
- func (m *MyMsg) Reset()
- func (m *MyMsg) String() string
- func (m *MyMsg) XXX_DiscardUnknown()
- func (m *MyMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MyMsg) XXX_Merge(src proto.Message)
- func (m *MyMsg) XXX_Size() int
- func (m *MyMsg) XXX_Unmarshal(b []byte) error
- type MyMsg_TYPE
- type Packet
- type Server
- type ServerConn
Constants ¶
View Source
const ( SEND_PROTO int = 8 RECV_PROTO int = 0 )
View Source
const ( FRAME_MAX_SIZE int = 888 FRAME_MAX_ID int = 1000000 )
Variables ¶
View Source
var MyMsg_TYPE_name = map[int32]string{
0: "DATA",
1: "PING",
2: "KICK",
57005: "MAGIC",
}
View Source
var MyMsg_TYPE_value = map[string]int32{
"DATA": 0,
"PING": 1,
"KICK": 2,
"MAGIC": 57005,
}
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AcceptDirectTcpConn ¶
func (*Client) AcceptSock5Conn ¶
func (*Client) LocalAddrToConnMapSize ¶
func (*Client) LocalIdToConnMapSize ¶
func (*Client) RecvPacket ¶
func (*Client) RecvPacketSize ¶
func (*Client) SendPacket ¶
func (*Client) SendPacketSize ¶
func (*Client) ServerAddr ¶
func (*Client) ServerIPAddr ¶
func (*Client) TargetAddr ¶
type ClientConn ¶
type ClientConn struct {
// contains filtered or unexported fields
}
type MyMsg ¶
type MyMsg struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"` Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` Rproto int32 `protobuf:"zigzag32,5,opt,name=rproto,proto3" json:"rproto,omitempty"` Magic int32 `protobuf:"zigzag32,6,opt,name=magic,proto3" json:"magic,omitempty"` Key int32 `protobuf:"zigzag32,7,opt,name=key,proto3" json:"key,omitempty"` Timeout int32 `protobuf:"varint,8,opt,name=timeout,proto3" json:"timeout,omitempty"` Tcpmode int32 `protobuf:"varint,9,opt,name=tcpmode,proto3" json:"tcpmode,omitempty"` TcpmodeBuffersize int32 `protobuf:"varint,10,opt,name=tcpmode_buffersize,json=tcpmodeBuffersize,proto3" json:"tcpmode_buffersize,omitempty"` TcpmodeMaxwin int32 `protobuf:"varint,11,opt,name=tcpmode_maxwin,json=tcpmodeMaxwin,proto3" json:"tcpmode_maxwin,omitempty"` TcpmodeResendTimems int32 `protobuf:"varint,12,opt,name=tcpmode_resend_timems,json=tcpmodeResendTimems,proto3" json:"tcpmode_resend_timems,omitempty"` TcpmodeCompress int32 `protobuf:"varint,13,opt,name=tcpmode_compress,json=tcpmodeCompress,proto3" json:"tcpmode_compress,omitempty"` TcpmodeStat int32 `protobuf:"varint,14,opt,name=tcpmode_stat,json=tcpmodeStat,proto3" json:"tcpmode_stat,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*MyMsg) Descriptor ¶
func (*MyMsg) GetTcpmode ¶
func (*MyMsg) GetTcpmodeBuffersize ¶
func (*MyMsg) GetTcpmodeCompress ¶
func (*MyMsg) GetTcpmodeMaxwin ¶
func (*MyMsg) GetTcpmodeResendTimems ¶
func (*MyMsg) GetTcpmodeStat ¶
func (*MyMsg) GetTimeout ¶
func (*MyMsg) ProtoMessage ¶
func (*MyMsg) ProtoMessage()
func (*MyMsg) XXX_DiscardUnknown ¶
func (m *MyMsg) XXX_DiscardUnknown()
func (*MyMsg) XXX_Marshal ¶
func (*MyMsg) XXX_Unmarshal ¶
type MyMsg_TYPE ¶
type MyMsg_TYPE int32
const ( MyMsg_DATA MyMsg_TYPE = 0 MyMsg_PING MyMsg_TYPE = 1 MyMsg_KICK MyMsg_TYPE = 2 MyMsg_MAGIC MyMsg_TYPE = 57005 )
func (MyMsg_TYPE) EnumDescriptor ¶
func (MyMsg_TYPE) EnumDescriptor() ([]byte, []int)
func (MyMsg_TYPE) String ¶
func (x MyMsg_TYPE) String() string
type ServerConn ¶
type ServerConn struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.