This commit is contained in:
crusader 2017-12-04 20:59:31 +09:00
parent 9527a68c71
commit 32230e44c8
5 changed files with 4 additions and 57 deletions

View File

@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net"
"strconv"
"sync"
"time"
@ -128,7 +129,7 @@ func handlePacketTCP(host *discoveryM.Host, dp *discoveryM.DiscoveryPort, ports
p := &discoveryM.Port{
PortType: oocmd.PortTypeTCP,
PortNumber: json.Number(port),
PortNumber: json.Number(strconv.Itoa(port)),
}
p.Host = host

View File

@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net"
"strconv"
"sync"
"time"
@ -143,7 +144,7 @@ func handlePacketUDP(host *discoveryM.Host, dp *discoveryM.DiscoveryPort, ports
p := &discoveryM.Port{
PortType: oocmd.PortTypeUDP,
PortNumber: json.Number(port),
PortNumber: json.Number(strconv.Itoa(port)),
UDPLayer: udpLayer,
}
p.Host = host

View File

@ -1,27 +0,0 @@
{
"level": "debug",
"development": true,
"disableCaller": true,
"disableStacktrace": true,
"sampling": {
"initial": 100,
"thereafter": 100
},
"encoding": "console",
"encoderConfig": {
"messageKey": "message",
"levelKey": "level",
"timeKey": "time",
"nameKey": "name",
"callerKey": "caller",
"stacktraceKey": "stacktrace",
"lineEnding": "\n",
"levelEncoder": "color",
"timeEncoder": "ISO8601",
"durationEncoder": "string",
"callerEncoder": "full",
"nameEncoder": "full"
},
"outputPaths": ["stdout", "/tmp/logs"],
"errorOutputPaths": ["stderr"]
}

View File

@ -1,28 +0,0 @@
package server
import "net"
func newConn(nconn net.Conn, contentType string) Conn {
c := &conn{
contentType: contentType,
}
c.Conn = nconn
return c
}
type Conn interface {
net.Conn
GetContentType() string
}
type conn struct {
net.Conn
contentType string
}
func (c *conn) GetContentType() string {
return c.contentType
}