-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListen.go
More file actions
46 lines (36 loc) · 727 Bytes
/
Listen.go
File metadata and controls
46 lines (36 loc) · 727 Bytes
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
39
40
41
42
43
44
45
46
package network
import (
"net"
)
type Listen struct {
id uint32
url *Url
event Event
protocol Protocol
conn net.Conn
newConnect func(listen ListenTcp, conn net.Conn) Connect
}
func (c *Listen) SetUrl(address *Url) {
c.url = address
}
func (c *Listen) Url() *Url {
return c.url
}
func (c *Listen) SetEvent(event Event) {
c.event = event
}
func (c *Listen) Event() Event {
return c.event
}
func (c *Listen) SetProtocol(protocol Protocol) {
c.protocol = protocol
}
func (c *Listen) Protocol() Protocol {
return c.protocol
}
func (c *Listen) Close() {
_ = c.conn.Close()
}
func (c *Listen) SetNewConnect(new func(listen ListenTcp, conn net.Conn) Connect) {
c.newConnect = new
}