Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
getty
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wei.xuan
getty
Commits
b4bd367f
Commit
b4bd367f
authored
Apr 24, 2020
by
AlexStocks
Committed by
watermelo
Jul 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Imp: new udp session
parent
4d0b3662
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
server.go
server.go
+16
-8
No files found.
server.go
View file @
b4bd367f
...
...
@@ -280,15 +280,23 @@ func (s *server) runTcpEventLoop(newSession NewSessionCallback) {
}
func
(
s
*
server
)
runUDPEventLoop
(
newSession
NewSessionCallback
)
{
var
(
ss
Session
)
s
.
wg
.
Add
(
1
)
go
func
()
{
defer
s
.
wg
.
Done
()
var
(
err
error
conn
*
net
.
UDPConn
ss
Session
)
ss
=
newUDPSession
(
s
.
pktListener
.
(
*
net
.
UDPConn
),
s
)
if
err
:=
newSession
(
ss
);
err
!=
nil
{
panic
(
err
.
Error
())
}
ss
.
(
*
session
)
.
run
()
conn
=
s
.
pktListener
.
(
*
net
.
UDPConn
)
ss
=
newUDPSession
(
conn
,
s
)
if
err
=
newSession
(
ss
);
err
!=
nil
{
conn
.
Close
()
panic
(
err
.
Error
())
}
ss
.
(
*
session
)
.
run
()
}()
}
type
wsHandler
struct
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment