func (mc *MatrixClient) Write(p *skn.Packet) { r := bytes.NewReader(p.Encode()) mc.cond.L.Lock() if mc.conn == nil { mc.cond.Wait() } c := mc.conn mc.cond.L.Unlock() io.Copy(c, r) }
func (ac *Agent) Write(p *skn.Packet) { data := p.Encode() io.Copy(ac.conn, bytes.NewReader(data)) }