add MsgServer.Close() method

networking
brl 10 years ago
parent bcf10f0045
commit ebf984b6b7

@ -64,8 +64,6 @@ func (s *MsgServer) Run() error {
for {
conn, err := s.listener.AcceptUnix()
if err != nil {
s.disp.close()
s.listener.Close()
return err
}
if err := setPassCred(conn); err != nil {
@ -84,6 +82,12 @@ func (s *MsgServer) Run() error {
return nil
}
func (s *MsgServer) Close() error {
s.disp.close()
close(s.done)
return s.listener.Close()
}
func Connect(address string, factory MsgFactory, log *logging.Logger, handlers ...interface{}) (*MsgConn, error) {
md, err := createDispatcher(log, handlers...)
if err != nil {

Loading…
Cancel
Save