2018-03-14 09:36:59 +00:00
|
|
|
package network
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
// Transporter is an interface that allows us to abstract
|
|
|
|
// any form of communication between the server and its peers.
|
|
|
|
type Transporter interface {
|
2022-11-17 14:07:19 +00:00
|
|
|
Dial(addr string, timeout time.Duration) (AddressablePeer, error)
|
2018-03-14 09:36:59 +00:00
|
|
|
Accept()
|
|
|
|
Proto() string
|
2022-11-29 14:43:08 +00:00
|
|
|
HostPort() (string, string)
|
2018-03-14 09:36:59 +00:00
|
|
|
Close()
|
|
|
|
}
|