I have 3 instances of kcp object A, B, C.
from A to B . A sends data and B it is getting received properly.
From B to C also its working fine.
But when i now send data from C to B . ikcp_recv returns -1
Note ikcp_send/recv are in 2 different thread.
i read in issue section about thread safety .
so the question is . is it like that we can only either send or recv from 1 kcp object at a time not send and recv in parallel.
2条答案
按热度按时间btxsgosb1#
kcp is not thread-safe, and should be guarded by a mutex.
1mrurvl12#
@skywind3000 I have put mutex lock and unlock in function written in ikcp.c, still the same behavior.
when i forcing kcp->rcv_nxt = 0; its worked fine.