Add client abridged protocol

This commit is contained in:
9seconds
2019-10-10 07:22:08 +03:00
parent 1a7eee444e
commit e81c5970d4
32 changed files with 538 additions and 174 deletions
+21
View File
@@ -0,0 +1,21 @@
package stream
import (
"net"
"github.com/9seconds/mtg/conntypes"
)
func NewClientConn(parent net.Conn, connID conntypes.ConnID) conntypes.StreamReadWriteCloser {
conn := newConn(parent, connID, connPurposeClient)
conn = NewTrafficStats(conn)
return conn
}
func NewTelegramConn(dc conntypes.DC, parent net.Conn) conntypes.StreamReadWriteCloser {
conn := newConn(parent, conntypes.ConnID{}, connPurposeTelegram)
conn = NewTelegramStats(dc, conn)
return conn
}