/*
+ * Acess2 Network Tester
+ * - By John Hodge (thePowersGang)
+ *
+ * cmdline_backend.c
+ * - Backend Thread for 'cmdline' suite
*/
-#define DEBUG 1
+#define DEBUG 0
#include "cmdline.h"
#include "tcpserver.h"
#include <vfs_ext.h>
int max = -1;
FD_ZERO(&rfd);
+ FD_ZERO(&wfd);
LOG("gpCmdline_TCPEchoServer = %p", gpCmdline_TCPEchoServer);
if(gpCmdline_TCPEchoServer)
max = MAX(max, NetTest_TCPServer_FillSelect(gpCmdline_TCPEchoServer, &rfd));
- memcpy(&wfd, &rfd, sizeof(rfd));
+ //memcpy(&wfd, &rfd, sizeof(rfd));
memcpy(&efd, &rfd, sizeof(rfd));
LOG("max = %i", max);
- int rv = VFS_Select(max+1, &rfd, &wfd, &efd, NULL, THREAD_EVENT_USER1, true);
+ int rv = VFS_Select(max+1, &rfd, &wfd, &efd, NULL, THREAD_EVENT_USER1, false);
LOG("rv = %i", rv);
+ if( rv < 0 ) {
+ // Oh, shite
+ }
+
+ // Woken with no file changes, skip checking
+ if( rv == 0 )
+ continue ;
+
if(gpCmdline_TCPEchoServer)
NetTest_TCPServer_HandleSelect(gpCmdline_TCPEchoServer, &rfd, &wfd, &efd);
}