You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
events.Data = func(c evio.Conn, in []byte) (out []byte, action evio.Action) {
fmt.Println("events.Data ")
if in == nil {
//how to know is close action?
fmt.Println("in is nil Closed")
action = evio.Close
return
} else {
// how to send data????????
fmt.Println("dataToSend ")
//dataToSend := c.Context().([]byte)
//if dataToSend != nil {
// out = append(out, dataToSend...)
// return
//}
}
fmt.Println("ReceiveData ")
fmt.Println(string(in))
toConn, _ := getconnByJsonData(c, in)
if toConn != nil {
fmt.Println("send Data ")
toConn.SetContext(in)
toConn.Wake()
}
return
}
I save conn in a map userid->conn
and get it by getconnByJsonData(c, in)
how to send data to other conn?
The text was updated successfully, but these errors were encountered:
events.Data = func(c evio.Conn, in []byte) (out []byte, action evio.Action) {
fmt.Println("events.Data ")
if in == nil {
//how to know is close action?
fmt.Println("in is nil Closed")
action = evio.Close
return
I save conn in a map userid->conn
and get it by getconnByJsonData(c, in)
how to send data to other conn?
The text was updated successfully, but these errors were encountered: