(conn net.Conn, updCh chan<- mess.Update)
| 58 | } |
| 59 | |
| 60 | func (usp *UnixSockPipe) readUpdates(conn net.Conn, updCh chan<- mess.Update) { |
| 61 | scnr := bufio.NewScanner(conn) |
| 62 | for scnr.Scan() { |
| 63 | id, upd, err := parseUpdate(scnr.Text()) |
| 64 | if err != nil { |
| 65 | usp.Log.Error("malformed update received", err, "str", scnr.Text()) |
| 66 | } |
| 67 | |
| 68 | // It is our own update, skip. |
| 69 | if id == usp.myID() { |
| 70 | continue |
| 71 | } |
| 72 | |
| 73 | updCh <- *upd |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | func (usp *UnixSockPipe) Listen(upd chan<- mess.Update) error { |
| 78 | l, err := netresource.Listen("unix", usp.SockPath) |
no test coverage detected