1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-07-01 08:10:22 +08:00

feat(p2p): support tcp protocol

This commit is contained in:
源文雨
2024-07-16 21:38:45 +09:00
parent 17e1f6cac9
commit 739cf863f1
19 changed files with 393 additions and 26 deletions

View File

@@ -52,7 +52,7 @@ func (conn *Conn) ReadFromPeer(b []byte) (int, p2p.EndPoint, error) {
func (conn *Conn) WriteToPeer(b []byte, ep p2p.EndPoint) (int, error) {
udpep, ok := ep.(*EndPoint)
if !ok {
return 0, ErrEndpointTypeMistatch
return 0, p2p.ErrEndpointTypeMistatch
}
return (*net.UDPConn)(conn).WriteTo(b, (*net.UDPAddr)(udpep))
}