HTTP-stream done

This commit is contained in:
serverericoza 2010-06-06 21:40:23 +02:00
parent 15a5eb42fe
commit ff6f3d6f57
2 changed files with 12 additions and 7 deletions

View file

@ -6,12 +6,14 @@
int main() {
SWUnixSocket mySocket;
mySocket.connect("../socketfile");
std::string msg;
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.recvmsg();
std::cout << msg;
msg = mySocket.recv(&buffer[0],10000);
std::cout.write(buffer,msg);
}
// disconnect
mySocket.disconnect();