Update readme.md
This commit is contained in:
parent
51d03937c2
commit
d79ed15728
1 changed files with 3 additions and 9 deletions
|
@ -86,12 +86,6 @@ func (s *Server) Start(address string) error {
|
|||
}
|
||||
log.Println("listening on " + address)
|
||||
|
||||
s.grp.Add(1)
|
||||
go func() {
|
||||
defer s.grp.Done()
|
||||
s.listenAndServe(l)
|
||||
}()
|
||||
|
||||
s.grp.Add(1)
|
||||
go func() {
|
||||
defer s.grp.Done()
|
||||
|
@ -115,7 +109,8 @@ func (s *Server) Start(address string) error {
|
|||
}
|
||||
}()
|
||||
|
||||
return nil
|
||||
// listenAndServe blocks until the server is shut down, just like http.ListenAndServe()
|
||||
return s.listenAndServe(l)
|
||||
}
|
||||
|
||||
|
||||
|
@ -123,8 +118,7 @@ func (s *Server) Start(address string) error {
|
|||
|
||||
s := NewServer()
|
||||
log.Println("starting")
|
||||
s.Start("localhost:1234")
|
||||
log.Println("started")
|
||||
go s.Start("localhost:1234")
|
||||
|
||||
// ... do some other things here ...
|
||||
|
||||
|
|
Loading…
Reference in a new issue