Documentation ¶
Index ¶
- type NetConn
- func (c *NetConn) Close() error
- func (c *NetConn) Recv(N int) ([]byte, error)
- func (c *NetConn) RecvHex(N int) (string, error)
- func (c *NetConn) RecvString(N int) (string, error)
- func (c *NetConn) Send(data string) error
- func (c *NetConn) SendArray(data []interface{}) error
- func (c *NetConn) SendHex(data string) error
- func (c *NetConn) SetTimeout(value int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NetConn ¶
type NetConn struct {
// contains filtered or unexported fields
}
NetConn is a connection to a remote host.
func Open ¶
Open opens a new connection to the address with a timeout. supported protocols: tcp, udp
func OpenTLS ¶
Open opens a new connection to the address with a timeout. supported protocols: tcp, udp
func (*NetConn) Recv ¶
Recv receives data from the connection with a timeout. If N is 0, it will read all data sent by the server with 8MB limit.
func (*NetConn) RecvHex ¶
RecvHex receives data from the connection with a timeout in hex format. If N is 0,it will read all data sent by the server with 8MB limit.
func (*NetConn) RecvString ¶
RecvString receives data from the connection with a timeout output is returned as a string. If N is 0, it will read all data sent by the server with 8MB limit.
func (*NetConn) SetTimeout ¶
SetTimeout sets read/write timeout for the connection (in seconds).