This commit is contained in:
crusader 2017-12-05 12:29:49 +09:00
parent 7e2813ad35
commit 84a1d91c52
4 changed files with 26 additions and 36 deletions

View File

@ -5,11 +5,7 @@ import (
) )
func NewSocketBuilder(address string) csc.SocketBuilder { func NewSocketBuilder(address string) csc.SocketBuilder {
sb := &SocketBuilders{} return newSocketBuilder(address)
sb.Network = "tcp"
sb.Address = "localhost:50006"
return sb
} }
type SocketBuilders struct { type SocketBuilders struct {

View File

@ -2,7 +2,6 @@ package server
import ( import (
"fmt" "fmt"
"net"
"git.loafle.net/commons_go/logging" "git.loafle.net/commons_go/logging"
"git.loafle.net/overflow/overflow_discovery/discovery" "git.loafle.net/overflow/overflow_discovery/discovery"
@ -34,11 +33,6 @@ func (sh *ServerHandlers) Init(serverCTX server.ServerContext) error {
return nil return nil
} }
func (sh *ServerHandlers) Listen(serverCTX server.ServerContext) (net.Listener, error) {
return net.Listen("tcp", "localhost:50006")
}
func (sh *ServerHandlers) OnStart(serverCTX server.ServerContext) { func (sh *ServerHandlers) OnStart(serverCTX server.ServerContext) {
sh.ServerHandlers.OnStart(serverCTX) sh.ServerHandlers.OnStart(serverCTX)

View File

@ -1,17 +1,17 @@
package server package server
// import ( import (
// "net" "net"
// "os" "os"
// "git.loafle.net/commons_go/server" "git.loafle.net/commons_go/server"
// ) )
// func (sh *ServerHandlers) Listen(serverCTX server.ServerContext) (net.Listener, error) { func (sh *ServerHandlers) Listen(serverCTX server.ServerContext) (net.Listener, error) {
// os.Remove(sh.addr) os.Remove(sh.addr)
// l, err := net.ListenUnix("unix", &net.UnixAddr{Name: sh.addr, Net: "unix"}) l, err := net.ListenUnix("unix", &net.UnixAddr{Name: sh.addr, Net: "unix"})
// if nil == err { if nil == err {
// os.Chmod(sh.addr, 0777) os.Chmod(sh.addr, 0777)
// } }
// return l, err return l, err
// } }

View File

@ -1,16 +1,16 @@
package server package server
// import ( import (
// "net" "net"
// "git.loafle.net/commons_go/server" "git.loafle.net/commons_go/server"
// "gopkg.in/natefinch/npipe.v2" "gopkg.in/natefinch/npipe.v2"
// ) )
// func (sh *ServerHandlers) Listen(serverCTX server.ServerContext) (net.Listener, error) { func (sh *ServerHandlers) Listen(serverCTX server.ServerContext) (net.Listener, error) {
// ln, err := npipe.Listen(`\\.\pipe\` + sh.addr) ln, err := npipe.Listen(`\\.\pipe\` + sh.addr)
// if err != nil { if err != nil {
// // handle error // handle error
// } }
// return ln, err return ln, err
// } }