Porting PicoTCP WIP
This commit is contained in:
19
user/diagdummy/tcptest.c
Normal file
19
user/diagdummy/tcptest.c
Normal file
@ -0,0 +1,19 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <ulib.h>
|
||||
|
||||
#define MAX_CONNS 10
|
||||
|
||||
void diagdummy_tcptest(void) {
|
||||
netsock_t netsock = ipc_netsockmake(NETSOCK_IPV4, NETSOCK_TCP, 1);
|
||||
ipc_netsocklisten(netsock, MAX_CONNS);
|
||||
|
||||
for (;;) {
|
||||
netsockev_t ev = ipc_netsockpollev(netsock);
|
||||
|
||||
if (!IS_NETSOCKEV_READY(ev)) {
|
||||
schedrelease();
|
||||
} else {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user