File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ func (a *App) OnStart(cb func()) *App {
4949
5050// OnBind calls the passed callback for every address, that was bound without any errors
5151func (a * App ) OnBind (cb func (addr string )) * App {
52- a .hooks .OnListenerStart = cb
52+ a .hooks .OnBind = cb
5353 return a
5454}
5555
@@ -136,8 +136,8 @@ func (a *App) bind(r router.Router) ([]*tcp.Server, error) {
136136 src .Handler = a .newHTTPHandler (encryption .Plain )
137137 }
138138
139- if a .hooks .OnListenerStart != nil {
140- a .hooks .OnListenerStart (src .Addr )
139+ if a .hooks .OnBind != nil {
140+ a .hooks .OnBind (src .Addr )
141141 }
142142
143143 servers = append (servers , tcp .NewServer (listener , func (conn net.Conn ) {
@@ -199,9 +199,9 @@ func (a *App) newHTTPHandler(enc encryption.Token) listenerHandler {
199199}
200200
201201type hooks struct {
202- OnStart func ()
203- OnListenerStart func (addr string )
204- OnStop func ()
202+ OnStart func ()
203+ OnBind func (addr string )
204+ OnStop func ()
205205}
206206
207207func callIfNotNil (f func ()) {
You can’t perform that action at this time.
0 commit comments