Get returns existing session to the node, if not exist try best to create one.
(id proto.NodeID)
| 152 | |
| 153 | // Get returns existing session to the node, if not exist try best to create one. |
| 154 | func (p *SessionPool) Get(id proto.NodeID) (conn rpc.Client, err error) { |
| 155 | var sess *Session |
| 156 | sess, _ = p.getSession(id) |
| 157 | return sess.Get() |
| 158 | } |
| 159 | |
| 160 | // oneOffMuxConn wraps a mux.Session to implement net.Conn. |
| 161 | type oneOffMuxConn struct { |