I am unclear what did I do less. The client access index.html. Server receives access request, create client_fd 1, read the client’s request. Receive a client needs to access the index.html, the server returns the request. HTTP/1.1 200 OKrnConnection: Keep-AlivernContent-Type: text/htmlrnrn <html> <head> <h1>hello wrold</h1> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <p>访问成功</p> <img src="linux.png"></img> ..
In my code basic connectivity and file transfer(.csv) work. But I want to send a file periodically from server to client in C++ every 10 seconds with updated data. I tried many things from google but didn’t find anything. I tried while loop to send the file(.csv) 300 times to a client but got, the ..
I prepared my server using NodeJS + Net library, and prepared my clients using C++ WinSock. But I have a problem. I can explain step by step: 1-) Server starts listening IP & port. 2-) A socket connects. 3-) We can communicate easily, there is no problem. 4-) After 4-5 minutes, it still keeps connected, ..
I’m trying to connect c++(server) with Python(client) for file transfer from one system to another. But my code is not working properly. And I’m using the ubuntu 20.04 LTS system. My Coding for C++ (Server) – Server.cpp #include <iostream> #include <stdlib.h> #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <string.h> #include <fstream> #include <unistd.h> ..
I wrote a windows service via Python that runs a TCP client every 7ms. However, the service receives data very slowly. When I run the client program once it is over in less than 2ms but for the service it takes 20ms each time it runs. Here is my code for the service: class PythonCornerExample(SMWinservice): ..
I’m trying to implement simple, bare-bones mini web server, it’s main and only task would be to send simple html/js page to client and then do real-time updates to it. Implementing transport layer is pretty simple, but I met surprising difficulties in server-side implementation of EventSource… Initially I tried this straightforward approach: #include <stdio.h> #include ..
I am currently writing a server application that should instruct multiple clients. I am unsure about the concept i have designed and would like to receive feedback on it. There are several identical clients that record and process sensor data. In addition, the results are sent to the server so that the server can react ..
I’m trying to find out when the server loses connection to the client. on the server side I have the following code: send(m_connectedSocket, Com, (unsigned)strlen(Com), 0); char* buf = new char[*size]; int timeout = 1000; int err = setsockopt(m_connectedSocket, SOL_SOCKET, SO_RCVTIMEO, (char *)& timeout, sizeof(int)); *size = recv(m_connectedSocket, buf, *size, 0); cout << *size << ..
I’m working on a TCP server where it receives image data from a mobile app and does some image processing on it. I managed to open a socket and receive the data successfully. However, the problem occurs when trying to run multiple threads to receive multiple connections simultaneously. The approach I’m taking is to create ..
Is there any tool for WINDOWS that can convert The Minecraft Bedrock Server UPD data into TCP so I can use Ngrok on it and then on client side convert TCP data back to UPD and connect to it? I can not port forward normally because my ISP does not allow it 🙁 I can ..