mistserver/Client/main.cpp
2010-06-08 15:47:43 +02:00

24 lines
543 B
C++

#include <iostream>
#include "sockets/SocketW.h"
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <unistd.h>
#include <fcntl.h>
int main() {
SWUnixSocket mySocket;
mySocket.connect("/tmp/socketfile");
char buffer[500000];
int msg;
// do something with mySocket...
std::cout << "HTTP/1.1 200 OK\nConnection: close\nContent-Type: video/x-flv\n\n";
while(true) {
msg = mySocket.recv(&buffer[0],10000);
std::cout.write(buffer,msg);
}
// disconnect
mySocket.disconnect();
return 0;
}