-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support graceful shutdown #148
base: master
Are you sure you want to change the base?
Conversation
diam/server.go
Outdated
@@ -137,6 +142,45 @@ func (c *conn) notifyClientGone() { | |||
} | |||
} | |||
|
|||
// A ConnState represents the state of a client connection to a server. | |||
type ConnState int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not int8 here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taken from https://github.com/golang/go/blob/master/src/net/http/server.go#L2823
looks like it can be an int8 afaict, can update
diam/server.go
Outdated
} | ||
|
||
func (c ConnState) String() string { | ||
return stateName[c] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name, ok := stateName[c]
if !ok {
return "UNDEFINED"
}
return name
This PR takes the minimal set of logic necessary to support graceful shutdown via a
Shutdown()
method from the std net/http serverNote: this does not implement the diameter peer disconnect