Add session creation commands for datagrams and raw sessions, stub out a repliable datagram dialer, add a DatagramConn interface that implements both net.Conn and net.PacketConn so that Dial can return a whole DatagramConn

This commit is contained in:
idk
2021-02-24 23:04:55 -05:00
parent f97683379f
commit 5af3086205
5 changed files with 59 additions and 5 deletions

19
datagram.go Normal file
View File

@ -0,0 +1,19 @@
package goSam
import (
"net"
"time"
)
type DatagramConn interface {
ReadFrom(p []byte) (n int, addr net.Addr, err error)
Read(b []byte) (n int, err error)
WriteTo(p []byte, addr net.Addr) (n int, err error)
Write(b []byte) (n int, err error)
Close() error
LocalAddr() net.Addr
RemoteAddr() net.Addr
SetDeadline(t time.Time) error
SetReadDeadline(t time.Time) error
SetWriteDeadline(t time.Time) error
}