Documentation
¶
Index ¶
- Constants
- type TcpConnection
- func (this *TcpConnection) Addr() string
- func (this *TcpConnection) Close() error
- func (this *TcpConnection) ConnProtocol() string
- func (this *TcpConnection) ReadMsg() ([]byte, error)
- func (this *TcpConnection) SetFlowProtocolHandler(flowProtocolHandler protocol.Proto)
- func (this *TcpConnection) WriteMsg(data []byte) error
- type TcpProtocol
Constants ¶
View Source
const TcpConnProtocol = "tcp"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TcpConnection ¶
type TcpConnection struct {
Conn net.Conn
Mutex sync.Mutex
// contains filtered or unexported fields
}
func NewTcpConnection ¶
func NewTcpConnection(conn net.Conn) *TcpConnection
func (*TcpConnection) Addr ¶
func (this *TcpConnection) Addr() string
func (*TcpConnection) Close ¶
func (this *TcpConnection) Close() error
func (*TcpConnection) ConnProtocol ¶ added in v1.0.1
func (this *TcpConnection) ConnProtocol() string
func (*TcpConnection) ReadMsg ¶
func (this *TcpConnection) ReadMsg() ([]byte, error)
func (*TcpConnection) SetFlowProtocolHandler ¶
func (this *TcpConnection) SetFlowProtocolHandler(flowProtocolHandler protocol.Proto)
func (*TcpConnection) WriteMsg ¶
func (this *TcpConnection) WriteMsg(data []byte) error
WriteMsg send byte array message
type TcpProtocol ¶
type TcpProtocol struct {
}
func (*TcpProtocol) Dial ¶
func (this *TcpProtocol) Dial(addr string) (protocol.Connection, error)
func (*TcpProtocol) ListenAndServe ¶
func (this *TcpProtocol) ListenAndServe(port int64, onConnect func(conn protocol.Connection)) error
Click to show internal directories.
Click to hide internal directories.