1
This commit is contained in:
parent
9cdb5698be
commit
a6d26d1a2b
36
server/imserver/WSPListener.go
Normal file
36
server/imserver/WSPListener.go
Normal file
@ -0,0 +1,36 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"net"
|
||||
)
|
||||
|
||||
type GGListener_ struct {
|
||||
listener net.Listener
|
||||
}
|
||||
|
||||
var GGListener = new (GGListener_)
|
||||
|
||||
func (this *GGListener_) Init() {
|
||||
listener, err := net.Listen("tcp", "0.0.0.0:8888")
|
||||
if err != nil {
|
||||
|
||||
} else {
|
||||
this.listener = listener
|
||||
go this.accept()
|
||||
}
|
||||
}
|
||||
|
||||
func (this *GGListener_) UnInit() {
|
||||
}
|
||||
|
||||
func (this *GGListener_) accept() {
|
||||
for {
|
||||
conn, err := this.listener.Accept()
|
||||
if err == nil {
|
||||
go this.socketRead(conn)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (this *GGListener_) socketRead(conn net.Conn) {
|
||||
}
|
@ -27,7 +27,7 @@ func (this *App_) UnInit() {
|
||||
}
|
||||
|
||||
func (this *App_) goReportServerState() {
|
||||
for (true) {
|
||||
for {
|
||||
params := q5.NewMxoObject()
|
||||
params.SetXValue("node_id", q5.NewXInt32(1))
|
||||
params.SetXValue("instance_id", q5.NewXInt32(1))
|
||||
|
Loading…
x
Reference in New Issue
Block a user