optimize tcp and udp punch

This commit is contained in:
TenderIronh
2023-07-29 20:36:35 +08:00
parent 8ebdf3341e
commit 46b4f78010
8 changed files with 339 additions and 332 deletions

View File

@@ -3,6 +3,7 @@ package openp2p
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"os"
"sync"
@@ -41,6 +42,10 @@ type AppConfig struct {
isUnderlayServer int // TODO: bool?
}
func (c *AppConfig) ID() string {
return fmt.Sprintf("%s%d", c.Protocol, c.SrcPort)
}
// TODO: add loglevel, maxlogfilesize
type Config struct {
Network NetworkConfig `json:"network"`