3 #include "IoTSocketServer.hpp"
4 #include "IoTRMIUtil.hpp"
9 #define SIZE 10 /* how many items per packet */
10 #define NUM_PACKS 3 /* number of times we'll do it */
12 int main(int argc, char *argv[])
17 /* if no command line arguments passed, we'll default to
18 these two port number */
23 IoTSocketServer mylink(port, &bResult);
26 printf("Failed to create Server object!\n");
30 /* put some dummy data in our arrays */
31 for (int i = 0,j = 100; i < SIZE; i++, j--)
36 printf("Server, waiting for connection...\n");
39 printf("Server, got a connection...\n");
43 mylink.receiveBytes(bytes);
44 cout << "Received bytes: ";
45 IoTRMIUtil::printBytes(bytes, 24, false);
47 printf("Server, closing connection...\n");
51 printf("Server, done...\n");