HTTP-stream done
This commit is contained in:
parent
15a5eb42fe
commit
ff6f3d6f57
2 changed files with 12 additions and 7 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue