|
|
@ -384,7 +384,8 @@ func onDataReadCallback(d unsafe.Pointer, cbuf *C.char, bufLen C.int) C.int {
|
|
|
|
n, err := conn.c.Read(buf)
|
|
|
|
n, err := conn.c.Read(buf)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
log.Println(err)
|
|
|
|
log.Println(err)
|
|
|
|
return -1
|
|
|
|
// 0 indicates connection termination
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//cbuf2 := C.CBytes(buf[:n])
|
|
|
|
//cbuf2 := C.CBytes(buf[:n])
|
|
|
|
// d := C.CString(string(buf[:n]))
|
|
|
|
// d := C.CString(string(buf[:n]))
|
|
|
|