Commit c668b44c authored by alexstocks's avatar alexstocks

use goext

parent 30608160
......@@ -26,6 +26,8 @@ import (
import (
"github.com/AlexStocks/getty"
"github.com/AlexStocks/gocolor"
"github.com/AlexStocks/goext/net"
"github.com/AlexStocks/goext/time"
log "github.com/AlexStocks/log4go"
)
......@@ -60,7 +62,7 @@ func initProfiling() {
addr string
)
addr = getty.HostAddress(conf.LocalHost, conf.ProfilePort)
addr = gxnet.HostAddress(conf.LocalHost, conf.ProfilePort)
log.Info("App Profiling startup on address{%v}", addr+pprofPath)
go func() {
log.Info(http.ListenAndServe(addr, nil))
......@@ -100,7 +102,7 @@ func initClient() {
client.gettyClient = getty.NewClient(
(int)(conf.ConnectionNum),
conf.connectInterval,
getty.HostAddress(conf.ServerHost, conf.ServerPort),
gxnet.HostAddress(conf.ServerHost, conf.ServerPort),
)
client.gettyClient.RunEventLoop(newSession)
}
......@@ -166,7 +168,7 @@ func test() {
var (
cost int64
counter getty.CountWatch
counter gxtime.CountWatch
)
counter.Start()
for i := 0; i < conf.EchoTimes; i++ {
......
......@@ -25,6 +25,7 @@ import (
import (
"github.com/AlexStocks/getty"
"github.com/AlexStocks/gocolor"
"github.com/AlexStocks/goext/net"
log "github.com/AlexStocks/log4go"
)
......@@ -66,7 +67,7 @@ func initProfiling() {
)
// addr = *host + ":" + "10000"
addr = getty.HostAddress(conf.Host, conf.ProfilePort)
addr = gxnet.HostAddress(conf.Host, conf.ProfilePort)
log.Info("App Profiling startup on address{%v}", addr+pprofPath)
go func() {
log.Info(http.ListenAndServe(addr, nil))
......@@ -127,7 +128,7 @@ func initServer() {
server = getty.NewServer()
// addr = *host + ":" + port
// addr = conf.Host + ":" + port
addr = getty.HostAddress2(conf.Host, port)
addr = gxnet.HostAddress2(conf.Host, port)
err = server.Listen("tcp", addr)
if err != nil {
panic(fmt.Sprintf("server.Listen(tcp, addr:%s) = error{%#v}", addr, err))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment