()
| 166 | } |
| 167 | |
| 168 | func (rp *remotePeer) Start() { |
| 169 | if rp.listenAddr == "" { |
| 170 | rp.listenAddr = "127.0.0.1:0" |
| 171 | } |
| 172 | |
| 173 | l, e := net.Listen("tcp", rp.listenAddr) // any available address |
| 174 | if e != nil { |
| 175 | golog.Fatalf("net.Listen tcp :0: %+v", e) |
| 176 | } |
| 177 | rp.listener = l |
| 178 | rp.addr = NewNetAddress(PubKeyToID(rp.PrivKey.PubKey()), l.Addr()) |
| 179 | if rp.channels == nil { |
| 180 | rp.channels = []byte{testCh} |
| 181 | } |
| 182 | go rp.accept() |
| 183 | } |
| 184 | |
| 185 | func (rp *remotePeer) Stop() { |
| 186 | rp.listener.Close() |
no test coverage detected