【1】官方给的文档→_→ 不得不说不好使
int communication(int X, int Y, int Z, int A, int B, int C, int ATTR, int ID);
int main(void)
{
communication(91,-61,24,14,17,20,1,1);
return 0;
}
int communication(int X,int Y,int Z,int A,int B,int C,int ATTR,int ID )
{
WSADATA wsd;
SOCKET admin;
SOCKET Client;
int retVal;
char buf[BUF_SIZE];
//int X = 91, Y = -61, Z = 24, A = 14, B = 17,C=20,ATTR=1,ID=1;
if (WSAStartup(MAKEWORD(2, 2), &wsd) != 0)
{
//printf("WASStartup failed !\n");
std::cout << "WASStartup failed !" << std::endl;
return 1;
}
admin = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (admin == INVALID_SOCKET)
{
//printf("socket failed !\n");
std::cout <