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:
19
datagram.go
Normal file
19
datagram.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user