Tx send data buf to peer
(p *peer.Peer, msg types.Message)
| 233 | |
| 234 | //Tx send data buf to peer |
| 235 | func (this *NetServer) Send(p *peer.Peer, msg types.Message) error { |
| 236 | if p != nil { |
| 237 | return p.Send(msg) |
| 238 | } |
| 239 | log.Warn("[p2p]send to a invalid peer") |
| 240 | return errors.New("[p2p]send to a invalid peer") |
| 241 | } |
| 242 | |
| 243 | //IsPeerEstablished return the establise state of given peer`s id |
| 244 | func (this *NetServer) IsPeerEstablished(p *peer.Peer) bool { |