const ( Timeout time.Duration = 1 * time.Second )
Connection is responsible for transferring packets via the network.
type Connection struct {
// contains filtered or unexported fields
}
func New(conn net.Conn, isIncoming bool) *Connection
func (c *Connection) AddAddresses(new []string)
func (c *Connection) Addresses() []string
Addresses returns a copy of address list associated with the connection.
func (c *Connection) ClearAddresses()
func (c *Connection) Close()
func (c *Connection) IsIncoming() bool
func (c *Connection) LocalAddr() string
func (c *Connection) Read() (*packet.Packet, error)
func (c *Connection) RegisterCloseHandler(f func(*Connection))
func (c *Connection) RemoteAddr() string
func (c *Connection) String() string
func (c *Connection) Write(p *packet.Packet) error