![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
demo versie 16/05
Dependencies: EthernetInterface mbed-rto mbed
Fork of ProjectVLC by
Diff: TCPlistener.cpp
- Revision:
- 38:47c075a354b5
- Parent:
- 33:2d4a2bfd0cd6
- Child:
- 50:c5cd73d93045
diff -r 381bcce15e3e -r 47c075a354b5 TCPlistener.cpp --- a/TCPlistener.cpp Wed May 02 06:33:40 2018 +0000 +++ b/TCPlistener.cpp Wed May 02 12:44:26 2018 +0000 @@ -8,7 +8,7 @@ eth.connect(); server.bind(4000); server.listen(); - server.set_blocking(false,0); + server.set_blocking(true); arraySize=10; } @@ -17,13 +17,10 @@ TCPSocketConnection client; server.accept(client); int n=client.receive(contents,size); - while(n==-1) - { - if(n!=-1){ + if(n!=-1){ contents[n] = '\0'; printf("Segment ontvangen van %s:%i met inhoud \"%s\"\r\n", client.get_address(),client.get_port(),contents); return true; - } } return false; } \ No newline at end of file