VRPN-main源码分析(1/2)
vrpn.c主函数main:
int main(int argc, char *argv[])
{
const char *config_file_name = "vrpn.cfg";
bool bail_on_error = true;
bool auto_quit = false;
bool flush_continuously = false;
int realparams = 0;
int i;
int port = vrpn_DEFAULT_LISTEN_PORT_NO;
#ifdef _WIN32
int milli_sleep_time = 0;
#else
int milli_sleep_time = 1;
#endif
#ifdef _WIN32
WSADATA wsaData;
int status;
//windows下socket编程的启动命令,为了后续使用
//Windows Sockets API函数
if ((status = WSAStartup(MAKEWORD(1, 1), &wsaData)) != 0) {
fprintf(stderr, "WSAStartup failed with %d\n", status);
return (1);
}
//设置了多种信号处理函数,都是用来让vrpn 退出
//下面的while循环
SetConsoleCtrlHandler(handleConsoleSignalsWin, TRUE);
#else
#ifdef sgi
sigset(SIGINT, sighandler);
sigset(SIGKIL