Skip to content

Commit

Permalink
cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
ineiti committed Jan 13, 2017
1 parent 115c28d commit e0cbd41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ test_verbose:
test_go:
./coveralls.sh

test: test_fmt test_lint test_playground
test: test_fmt test_lint test_go

5 changes: 3 additions & 2 deletions local.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,12 @@ func NewPrivIdentity(port int) (abstract.Scalar, *network.ServerIdentity) {
// NewTCPServer creates a new server with a tcpRouter with "localserver:"+port as an
// address.
func NewTCPServer(port int) *Server {
log.Print(port)
priv, id := NewPrivIdentity(port)
addr := network.NewTCPAddress(id.Address.NetworkAddress())
var tcpHost *network.TCPHost
// For the websocket we need a port at the address one higher than the
// TCPHost. Let TCPHost chose a port, then check if the port+1 is also
// available. Else redo the search.
for {
var err error
tcpHost, err = network.NewTCPHost(addr)
Expand All @@ -326,7 +328,6 @@ func NewTCPServer(port int) *Server {
h := NewServer(router, priv)
go h.Start()
for !h.Listening() {
log.Print("Waiting to listen on", port)
time.Sleep(10 * time.Millisecond)
}
return h
Expand Down

0 comments on commit e0cbd41

Please sign in to comment.