WAFer icon indicating copy to clipboard operation
WAFer copied to clipboard

check send buf before sending data?

Open Charles0429 opened this issue 11 years ago • 1 comments

Now in nope.c, send function is called without checking whether the kernel send buffer is enough using select. For example, there are 100 active clients, we need to send 1k data to each client, but the total kernel buffer is 10k (just as an example), we know that when send function is finished, it only ensures the data of process is copied into kernel send buffer, maybe when dealing with the 50th client, the kernel buffer is full, then the process will blocked until the kernel buffer has enough space for data.

Charles0429 avatar Jul 30 '14 01:07 Charles0429

I think we need to use select to check for write event, and use non blocking write to avoid blocking state.

Charles0429 avatar Jul 30 '14 01:07 Charles0429