?? compat.cpp.svn-base
字號:
#include <string>#include <vector>#include "compat.h"bool Connect(SOCKET sockfd, const SOCKADDR_IN& addr) { return bool(connect(sockfd, (sockaddr*)&addr, addr.get_size()) == 0);}bool Socket(SOCKET& s, int domain, int type, int protocol) { s = socket(AF_INET, type, protocol); return bool(s != -1);}bool Send(int &CharsSent, SOCKET s, const char *msg, size_t len, int flags) { CharsSent = send(s, msg, len, flags); return bool((CharsSent != -1));}bool Recv(int &CharsRecv, SOCKET s, char *buf, size_t len, int flags) { CharsRecv = recv(s, buf, len, flags); return bool((CharsRecv != -1));}// just wrap the call to shutdown the connection on a socket// this way I don't have to call it this way everywhere.void Closesocket(const SOCKET& s) { close(s);}void initNetworking() { return;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -