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
|
2020-05-22 09:17:17 +00:00
|
|
|
Address() string
|
2018-03-14 09:36:59 +00:00
|
|
|
Close()
|
|
|
|
}
|