forked from zubairhamed/canopus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverconn.go
38 lines (29 loc) · 810 Bytes
/
serverconn.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package canopus
import (
"net"
"time"
)
type UDPServerConnection struct {
conn net.PacketConn
}
func (uc *UDPServerConnection) ReadFrom(b []byte) (n int, addr net.Addr, err error) {
return uc.conn.ReadFrom(b)
}
func (uc *UDPServerConnection) WriteTo(b []byte, addr net.Addr) (n int, err error) {
return uc.conn.WriteTo(b, addr)
}
func (uc *UDPServerConnection) Close() error {
return uc.conn.Close()
}
func (uc *UDPServerConnection) LocalAddr() net.Addr {
return uc.conn.LocalAddr()
}
func (uc *UDPServerConnection) SetDeadline(t time.Time) error {
return uc.conn.SetDeadline(t)
}
func (uc *UDPServerConnection) SetReadDeadline(t time.Time) error {
return uc.conn.SetReadDeadline(t)
}
func (uc *UDPServerConnection) SetWriteDeadline(t time.Time) error {
return uc.conn.SetWriteDeadline(t)
}