| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Since we forked geth, is there any existing code to reuse or reference. |
Sorry, something went wrong.
| } | ||
|
|
||
| type Client struct { | ||
| DiscV5API *discover.DiscV5API |
There was a problem hiding this comment.
DiscV5API is not needed to close. In fact, all network use the same UDPv5, every network will stop the discv5 when call the Stop method
Sorry, something went wrong.
There was a problem hiding this comment.
Since DiscV5 not managed by sub networks, I would like to suggest we don't close discV5 in sub networks close function and close by the outside management object.
Sorry, something went wrong.
There was a problem hiding this comment.
I tried to move the closure of DiskV5 from PortalProtocol, where it was originally, to main, but it broke a test and may potentially break other parts of the code that calls PortalProtocol.Close().
DiscV5 close uses a sync.Once struct and can safely be closed many times:
Line 193 in b061173
Sorry, something went wrong.
The reference comes from Line 77 in b061173 Line 115 in b061173 I studied this file to understand how to handle a syscall.SIGINT or a syscall.SIGTERM signals, but I believe it is not possible to reuse this code to deal with Shisui since geth implements an anonymous goroutine. Other aspect is the behavior/functionality of CTRL-C command: in geth to force quit is necessary to press 10 times CTRL-C, or panic behavior: for i := 10; i > 0; i-- {
<-sigc
if i > 1 {
log.Warn("Already shutting down, interrupt more to panic.", "times", i-1)
}
}while in Shisui only a second press of CTRL-c quits. Please let me know if there is a better approach I should implement. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
solves #156