![](/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:
- 36:aa6c6c177be2
- Parent:
- 33:2d4a2bfd0cd6
- Parent:
- 35:efdbfccf2678
- Child:
- 37:4589f962697d
--- a/TCPlistener.cpp Wed May 02 06:33:40 2018 +0000 +++ b/TCPlistener.cpp Wed May 02 08:11:42 2018 +0000 @@ -1,5 +1,9 @@ #include "TCPlistener.h" +/** +* Initialise with ip address of 192.168.0.253, a mask of 255.255.255.0 and a gateway of 192.168.0.254. +* Starts a TCP server which will listen on port 4000. +*/ TCPlistener::TCPlistener(){ char ip[]="192.168.0.253"; char mask[]="255.255.255.0"; @@ -9,9 +13,15 @@ server.bind(4000); server.listen(); server.set_blocking(false,0); - arraySize=10; + //arraySize=10; } +/** +* Receives all packets sent to 192.168.0.253:4000. The receive is non blocking. +* @param contents The location where the segment contents will be written, formatted as null terminated character array. +* @param size The max size of the "contents" array. +* @return True if a segment was received, false if no segment was received. +*/ bool TCPlistener::receiveSegment(char *contents,int size){ printf("Maak een connectie.\r\n"); TCPSocketConnection client;