同步操作将从 Gitee 极速下载/MiniGUI 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#define LISTEN_SOCKET "/var/tmp/mysocket"static int listen_fd;BOOL listen_socket (HWND hwnd){if ((listen_fd = serv_listen (LISTEN_SOCKET)) < 0)return FALSE;return RegisterListenFD (fd, POLL_IN, hwnd, NULL);}/** When the server receives the request to connect from a client,* the window hwnd will receive a MSG_FDEVENT message.* Now the server can accept the request.*/LRESULT MyWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){switch (message) {...case MSG_FDEVENT:if (LOWORD (wParam) == listen_fd) {/* This message comes from the listen socket fd. */pid_t pid;uid_t uid;int conn_fd;conn_fd = serv_accept (listen_fd, &pid, &uid);if (conn_fd >= 0) {RegisterListenFD (conn_fd, POLL_IN, hwnd, NULL);}}else {/* Client send a request. */int fd = LOWORD(wParam);/* Handle the request from client. */sock_read_t (fd, ...);sock_write_t (fd, ....);}break;...}}/** Clients can use the following code to connect itself to the server.*/int conn_fd;if ((conn_fd = cli_conn (LISTEN_SOCKET, 'b')) >= 0) {/* Send a request to the server. */sock_write_t (fd, ....);/* Get the reply from the server. */sock_read_t (fd, ....);}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。