|
|
|
@ -92,7 +92,7 @@ const (
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func ListenStatMNG() (icserr *icserror.IcsError) {
|
|
|
|
|
l := icslog.GetIcsLog()
|
|
|
|
|
// l := icslog.GetIcsLog()
|
|
|
|
|
conf := icsconf.GetIcsConfig()
|
|
|
|
|
|
|
|
|
|
//start bot-command listen
|
|
|
|
@ -104,17 +104,18 @@ func ListenStatMNG() (icserr *icserror.IcsError) {
|
|
|
|
|
var cmdErr *icserror.IcsError
|
|
|
|
|
statTCP, cmdErr := icsnet.ListenAndServeTCP(&statLocalAddr, nil, "\r\n", StatsCommandVG)
|
|
|
|
|
if cmdErr != nil {
|
|
|
|
|
l.Printf(icslog.LOG_LEVEL_FATAL, -1, "%s", cmdErr.GetError())
|
|
|
|
|
// l.Printf(icslog.LOG_LEVEL_FATAL, -1, "%s", cmdErr.GetError())
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
l.Printf(icslog.LOG_LEVEL_INFO, -1, "Listening Stat TCP Command %s port[%d]", statTransport, statPort)
|
|
|
|
|
fmt.Printf("Listening Stat TCP Command %s port[%d]", statTransport, statPort)
|
|
|
|
|
// l.Printf(icslog.LOG_LEVEL_INFO, -1, "Listening Stat TCP Command %s port[%d]", statTransport, statPort)
|
|
|
|
|
fmt.Println(statTCP)
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func ListenStatMNG1() (icserr *icserror.IcsError) {
|
|
|
|
|
l := icslog.GetIcsLog()
|
|
|
|
|
// l := icslog.GetIcsLog()
|
|
|
|
|
conf := icsconf.GetIcsConfig()
|
|
|
|
|
|
|
|
|
|
//start bot-command listen
|
|
|
|
@ -126,10 +127,11 @@ func ListenStatMNG1() (icserr *icserror.IcsError) {
|
|
|
|
|
var cmdErr *icserror.IcsError
|
|
|
|
|
statTCP, cmdErr := icsnet.ListenAndServeTCP(&statLocalAddr, nil, "\r\n", StatsCommandVA)
|
|
|
|
|
if cmdErr != nil {
|
|
|
|
|
l.Printf(icslog.LOG_LEVEL_FATAL, -1, "%s", cmdErr.GetError())
|
|
|
|
|
// l.Printf(icslog.LOG_LEVEL_FATAL, -1, "%s", cmdErr.GetError())
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
l.Printf(icslog.LOG_LEVEL_INFO, -1, "Listening Stat TCP Command %s port[%d]", statTransport, statPort)
|
|
|
|
|
fmt.Printf("Listening Stat TCP Command %s port[%d]", statTransport, statPort)
|
|
|
|
|
// l.Printf(icslog.LOG_LEVEL_INFO, -1, "Listening Stat TCP Command %s port[%d]", statTransport, statPort)
|
|
|
|
|
fmt.Println(statTCP)
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
@ -169,14 +171,14 @@ func StatsCommandVG(t *icsnet.IcsTCPNet, bufend string) {
|
|
|
|
|
|
|
|
|
|
defer t.Close()
|
|
|
|
|
|
|
|
|
|
l.Printf(icslog.LOG_LEVEL_INFO, -1, "Connected from - %s", t.RemoteAddr())
|
|
|
|
|
// l.Printf(icslog.LOG_LEVEL_INFO, -1, "Connected from - %s", t.RemoteAddr())
|
|
|
|
|
|
|
|
|
|
// for {
|
|
|
|
|
statReads, rlen, rerr := t.ReadS(10137, bufend) // 여기서 전체 몇 byte씩 읽어서 로그를 찍을건지 알아야함
|
|
|
|
|
if rerr != nil {
|
|
|
|
|
if rerr.GetError() != io.EOF {
|
|
|
|
|
l.Printf(icslog.LOG_LEVEL_ERROR, -1, "[Stat Command] ReadS Error! - %s[%d:%d]",
|
|
|
|
|
rerr.GetError(), rlen, len(statReads))
|
|
|
|
|
// l.Printf(icslog.LOG_LEVEL_ERROR, -1, "[Stat Command] ReadS Error! - %s[%d:%d]",
|
|
|
|
|
// rerr.GetError(), rlen, len(statReads))
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
@ -271,14 +273,14 @@ func StatsCommandVA(t *icsnet.IcsTCPNet, bufend string) {
|
|
|
|
|
|
|
|
|
|
defer t.Close()
|
|
|
|
|
|
|
|
|
|
l.Printf(icslog.LOG_LEVEL_INFO, -1, "Connected from - %s", t.RemoteAddr())
|
|
|
|
|
// l.Printf(icslog.LOG_LEVEL_INFO, -1, "Connected from - %s", t.RemoteAddr())
|
|
|
|
|
|
|
|
|
|
// for {
|
|
|
|
|
statReads, rlen, rerr := t.ReadS(10137, bufend) // 여기서 전체 몇 byte씩 읽어서 로그를 찍을건지 알아야함
|
|
|
|
|
if rerr != nil {
|
|
|
|
|
if rerr.GetError() != io.EOF {
|
|
|
|
|
l.Printf(icslog.LOG_LEVEL_ERROR, -1, "[Stat Command] ReadS Error! - %s[%d:%d]",
|
|
|
|
|
rerr.GetError(), rlen, len(statReads))
|
|
|
|
|
// l.Printf(icslog.LOG_LEVEL_ERROR, -1, "[Stat Command] ReadS Error! - %s[%d:%d]",
|
|
|
|
|
// rerr.GetError(), rlen, len(statReads))
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|