setup more proper logging and get stuff working maybe

This commit is contained in:
2025-03-26 20:57:23 -05:00
parent ea952e1981
commit ed8c594a30
5 changed files with 234 additions and 25 deletions

View File

@@ -24,12 +24,13 @@ int main() {
bind(serverSocket, reinterpret_cast<sockaddr *>(&serverAddress),
sizeof(serverAddress));
info("Ready to accept connections.");
// listening to the assigned socket
listen(serverSocket, 5);
// accepting connection request
int clientSocket
= accept(serverSocket, nullptr, nullptr);
int clientSocket = accept(serverSocket, nullptr, nullptr);
info("Client connected.");
// TODO: handle multiple images
cv::Mat image = cv::Mat::zeros(cv::Size(640, 480), CV_8UC3);
@@ -39,14 +40,13 @@ int main() {
while (running) {
// receive data
vector<uchar> buffer;
cout << "Receiving image" << endl;
trace("Receiving image");
recvImage(clientSocket, buffer);
cout << "Applying image" << endl;
trace("Applying new data to image");
applyImage(image, &buffer);
cout << "Displaying image" << endl;
trace("Displaying image");
imshow("image", image);
running = cv::waitKey(30) != 27;
}