|
|
@@ -2,6 +2,8 @@ package p2p
|
|
|
|
|
|
import (
|
|
|
"errors"
|
|
|
+ "fmt"
|
|
|
+ "sync"
|
|
|
)
|
|
|
|
|
|
var (
|
|
|
@@ -19,8 +21,8 @@ type Server struct {
|
|
|
//newPeerHook func(*Peer)
|
|
|
//listenFunc func(network, addr string) (net.Listener, error)
|
|
|
|
|
|
- //lock sync.Mutex // protects running
|
|
|
- //running bool
|
|
|
+ lock sync.Mutex // protects running
|
|
|
+ running bool
|
|
|
|
|
|
//listener net.Listener
|
|
|
//ourHandshake *protoHandshake
|
|
|
@@ -48,3 +50,9 @@ type Server struct {
|
|
|
// State of run loop and listenLoop.
|
|
|
//inboundHistory expHeap
|
|
|
}
|
|
|
+
|
|
|
+func (srv *Server) Start() (err error) {
|
|
|
+ fmt.Println("Hello World.")
|
|
|
+
|
|
|
+ return nil
|
|
|
+}
|