dedis / onet

Overlay Network for distributed protocols
GNU Lesser General Public License v3.0
50 stars 29 forks source link

Remove dependency on tylerb/graceful #663

Closed jeffallen closed 4 years ago

jeffallen commented 4 years ago

Fixes #601.

jeffallen commented 4 years ago

So go vet is mad because ./websocket.go:224:7: the cancel function returned by context.WithDeadline should be called, not discarded, to avoid a context leak. It seemed like due to async concerns I wouldn't be able to call that. Back to investigate more I guess.

nkcr commented 4 years ago

Simply do

    ctx, cancel := context.WithTimeout(context.Background(), 100 * time.Millisecond)
    defer cancel()
    w.server.SetKeepAlivesEnabled(false)
    w.server.Shutdown(ctx)
Gilthoniel commented 4 years ago

I changed the settings of the repository to comply with Travis like I did for the other repos. I forgot to do it with onet.