Гость
Asio не отвечает после отправки базового http-запроса
Сообщение
Гость » 09 мар 2024, 20:04
I'm new to asio and was follwing a tutorial. After sending a pretty basic http get request to example.com there is no response.
Код: Выделить всё
#include
#include
#include
#include
#define ASIO_STANDALONE
int main(){
asio::error_code ec;
asio::io_context context;
asio::ip::tcp::endpoint endpoint(asio::ip::make_address("93.184.216.34", ec), 80);
asio::ip::tcp::socket socket(context);
socket.connect(endpoint, ec);
std::cout 93.184.216.34.http: Flags [.], ack 1, win 251, options [nop,nop,TS val 2462554725 ecr 3857096832], length 0
16:53:57.236454 IP arch.44680 > 93.184.216.34.http: Flags [P.], seq 1:52, ack 1, win 251, options [nop,nop,TS val 2462554726 ecr 3857096832], length 51: HTTP: GET /index.html HTTP/1.1
16:53:57.236490 IP arch.44680 > 93.184.216.34.http: Flags [F.], seq 52, ack 1, win 251, options [nop,nop,TS val 2462554726 ecr 3857096832], length 0
16:53:57.357833 IP 93.184.216.34.http > arch.44680: Flags [.], ack 52, win 128, options [nop,nop,TS val 3857096953 ecr 2462554726], length 0
16:53:57.358428 IP 93.184.216.34.http > arch.44680: Flags [P.], seq 1:1613, ack 53, win 128, options [nop,nop,TS val 3857096953 ecr 2462554726], length 1612: HTTP: HTTP/1.1 200 OK
16:53:57.358429 IP 93.184.216.34.http > arch.44680: Flags [F.], seq 1613, ack 53, win 128, options [nop,nop,TS val 3857096953 ecr 2462554726], length 0
16:53:57.358458 IP arch.44680 > 93.184.216.34.http: Flags [R], seq 999815072, win 0, length 0
16:53:57.358487 IP arch.44680 > 93.184.216.34.http: Flags [R], seq 999815072, win 0, length 0
Источник:
https://stackoverflow.com/questions/781 ... tp-request
1710003884
Гость
I'm new to asio and was follwing a tutorial. After sending a pretty basic http get request to example.com there is no response. [code]#include #include #include #include #define ASIO_STANDALONE int main(){ asio::error_code ec; asio::io_context context; asio::ip::tcp::endpoint endpoint(asio::ip::make_address("93.184.216.34", ec), 80); asio::ip::tcp::socket socket(context); socket.connect(endpoint, ec); std::cout 93.184.216.34.http: Flags [.], ack 1, win 251, options [nop,nop,TS val 2462554725 ecr 3857096832], length 0 16:53:57.236454 IP arch.44680 > 93.184.216.34.http: Flags [P.], seq 1:52, ack 1, win 251, options [nop,nop,TS val 2462554726 ecr 3857096832], length 51: HTTP: GET /index.html HTTP/1.1 16:53:57.236490 IP arch.44680 > 93.184.216.34.http: Flags [F.], seq 52, ack 1, win 251, options [nop,nop,TS val 2462554726 ecr 3857096832], length 0 16:53:57.357833 IP 93.184.216.34.http > arch.44680: Flags [.], ack 52, win 128, options [nop,nop,TS val 3857096953 ecr 2462554726], length 0 16:53:57.358428 IP 93.184.216.34.http > arch.44680: Flags [P.], seq 1:1613, ack 53, win 128, options [nop,nop,TS val 3857096953 ecr 2462554726], length 1612: HTTP: HTTP/1.1 200 OK 16:53:57.358429 IP 93.184.216.34.http > arch.44680: Flags [F.], seq 1613, ack 53, win 128, options [nop,nop,TS val 3857096953 ecr 2462554726], length 0 16:53:57.358458 IP arch.44680 > 93.184.216.34.http: Flags [R], seq 999815072, win 0, length 0 16:53:57.358487 IP arch.44680 > 93.184.216.34.http: Flags [R], seq 999815072, win 0, length 0 [/code] Источник: [url]https://stackoverflow.com/questions/78133074/asio-no-response-afer-sending-a-basic-http-request[/url]