mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 21:34:02 +03:00
Add client abridged protocol
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user