Documentation ¶
Index ¶
- Variables
- type Codec
- type CodecReader
- type CodecWriter
- type TCPClient
- type TCPConnection
- func (this *TCPConnection) Close()
- func (this *TCPConnection) CloseWithTimeout(timeout time.Duration)
- func (this *TCPConnection) LocalAddr() net.Addr
- func (this *TCPConnection) RemoteAddr() net.Addr
- func (this *TCPConnection) Send(b []byte) error
- func (this *TCPConnection) SetNoDelay(noDelay bool) error
- func (this *TCPConnection) SetPendingSend(pendingSend int)
- func (this *TCPConnection) Shutdown()
- type TCPHandler
- type TCPServer
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultCodec *defaultCodec = &defaultCodec{}
View Source
var DefaultTCPHandler = &defaultTCPHandler{}
View Source
var (
ErrClientClosed = errors.New("network: Client closed")
)
View Source
var (
ErrConnectionPendingSendFull = errors.New("network: Connection pending send full")
)
View Source
var (
ErrServerClosed = errors.New("network: Server closed")
)
Functions ¶
This section is empty.
Types ¶
type TCPClient ¶
type TCPClient struct {
// contains filtered or unexported fields
}
func NewTCPClient ¶
func (*TCPClient) DialAndServe ¶
func (this *TCPClient) DialAndServe(handler TCPHandler, codec Codec) error
func (*TCPClient) DisableRetry ¶
func (this *TCPClient) DisableRetry()
func (*TCPClient) EnableRetry ¶
func (this *TCPClient) EnableRetry()
func (*TCPClient) GetConnection ¶
func (this *TCPClient) GetConnection() *TCPConnection
type TCPConnection ¶
type TCPConnection struct { Userdata interface{} // contains filtered or unexported fields }
func (*TCPConnection) Close ¶
func (this *TCPConnection) Close()
func (*TCPConnection) CloseWithTimeout ¶
func (this *TCPConnection) CloseWithTimeout(timeout time.Duration)
func (*TCPConnection) LocalAddr ¶
func (this *TCPConnection) LocalAddr() net.Addr
func (*TCPConnection) RemoteAddr ¶
func (this *TCPConnection) RemoteAddr() net.Addr
func (*TCPConnection) Send ¶
func (this *TCPConnection) Send(b []byte) error
func (*TCPConnection) SetNoDelay ¶
func (this *TCPConnection) SetNoDelay(noDelay bool) error
func (*TCPConnection) SetPendingSend ¶
func (this *TCPConnection) SetPendingSend(pendingSend int)
func (*TCPConnection) Shutdown ¶
func (this *TCPConnection) Shutdown()
type TCPHandler ¶
type TCPHandler interface { Connect(conn *TCPConnection, connected bool) Receive(conn *TCPConnection, buf []byte) }
type TCPServer ¶
type TCPServer struct {
// contains filtered or unexported fields
}
func NewTCPServer ¶
func (*TCPServer) ListenAndServe ¶
func (this *TCPServer) ListenAndServe(handler TCPHandler, codec Codec) error
Click to show internal directories.
Click to hide internal directories.