127 的主动唤醒 能提升运行延迟,挂普法太多了网络处理不过来,辅助性的刺激网卡呢

/////////////////////////////////////////////////////////// 编译 release ’发布版本‘

 

#include<Windows.h>
#include<stdlib.h>
#pragma comment(lib,"WS2_32.lib")
#include <corecrt_wstdlib.h>
#include <iostream>
#include<stdio.h>
#include <Windows.h>
#include<list>
#include<iostream>
#include<istream>
#include<ostream>
#include <fstream>
#include<string>
using namespace std;


WSADATA wsd;


int retVal;//调用Socket函数的返回值
char buf[255];


void main()
{

if (WSAStartup(MAKEWORD(2, 2), &wsd) != 0) {
printf("WSAStartup failed!\n");
}


SOCKADDR_IN ins;
ins.sin_addr.S_un.S_addr = (ULONG)"127.0.0.1";
ins.sin_family = AF_INET;
ins.sin_port = htons(80);

SOCKET soc;
soc = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
connect(soc, (LPSOCKADDR)&ins, sizeof(ins));

if (INVALID_SOCKET == soc)
{
printf("socket failed!\n");
return;
}

Sleep(32);

AS:


recv(soc, buf, 256, 0);


Sleep(20);


goto AS;


return;
};

posted on 2025-07-26 07:31  草丛有头猪  阅读(2)  评论(0)    收藏  举报

导航