Skip to content
Snippets Groups Projects
Commit 42f5331a authored by kr328's avatar kr328
Browse files

Fix: should close TCP/UDP endpoint on exit

parent e2383df0
No related branches found
No related tags found
No related merge requests found
...@@ -72,6 +72,8 @@ func Start(fd, mtu int, dns string) error { ...@@ -72,6 +72,8 @@ func Start(fd, mtu int, dns string) error {
go func() { go func() {
// lwip tcp // lwip tcp
defer stack.TCP().Close()
for { for {
conn, err := stack.TCP().Accept() conn, err := stack.TCP().Accept()
if err != nil { if err != nil {
...@@ -94,6 +96,8 @@ func Start(fd, mtu int, dns string) error { ...@@ -94,6 +96,8 @@ func Start(fd, mtu int, dns string) error {
go func() { go func() {
// lwip udp // lwip udp
defer stack.UDP().Close()
for { for {
buf := allocUDP(mtu) buf := allocUDP(mtu)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment