setup more proper logging and get stuff working maybe
This commit is contained in:
10
client.cpp
10
client.cpp
@@ -10,7 +10,7 @@ using namespace std;
|
||||
|
||||
int main() {
|
||||
// create video capture
|
||||
//cv::VideoCapture cap = cv::VideoCapture(0);
|
||||
cv::VideoCapture cap = cv::VideoCapture(0);
|
||||
|
||||
// create socket
|
||||
int clientSocket = socket(AF_INET, SOCK_STREAM, 0);
|
||||
@@ -21,18 +21,20 @@ int main() {
|
||||
serverAddress.sin_port = htons(8080);
|
||||
serverAddress.sin_addr.s_addr = INADDR_ANY;
|
||||
|
||||
cv::Mat image = cv::Mat(cv::Size(640, 480), CV_8UC3, cv::Scalar(255, 0, 0));
|
||||
cv::Mat image = cv::Mat::zeros(cv::Size(640, 480), CV_8UC3);
|
||||
|
||||
info("Ready to connect.");
|
||||
// sending connection request
|
||||
connect(clientSocket, reinterpret_cast<sockaddr *>(&serverAddress),
|
||||
sizeof(serverAddress));
|
||||
|
||||
info("Connected.");
|
||||
// create buffer for serialization
|
||||
vector<uchar> imgbuf;
|
||||
|
||||
while (true) {
|
||||
//cap.read(image);
|
||||
cout << "Sending image" << endl;
|
||||
cap.read(image);
|
||||
trace("Sending image");
|
||||
sendImage(clientSocket, image, imgbuf);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user