![](/media/cache/profiles/0230db486bc9cdd3583fee20469c7b2f.jpg.50x50_q85.jpg)
Simple TCP Client
Dependencies: CyaSSL EthernetInterface mbed-rtos mbed
Fork of SimpleClient-TCP-FRDM by
Revision 5:962734db89e5, committed 2014-12-08
- Comitter:
- wolfSSL
- Date:
- Mon Dec 08 13:17:25 2014 +0000
- Parent:
- 4:2c2359b7f24b
- Commit message:
- Cleaned;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 2c2359b7f24b -r 962734db89e5 main.cpp --- a/main.cpp Mon Dec 08 05:18:20 2014 +0000 +++ b/main.cpp Mon Dec 08 13:17:25 2014 +0000 @@ -37,7 +37,7 @@ EthernetInterface eth; -main() +void net_main(void const *av) { char server_ip[20] ; @@ -99,7 +99,7 @@ printf("SSL Connected\n") ; ***/ - char msg[] = "GET / HTTP/1.0\r\nConnection: Close\r\n\r\n" ; + char msg[] = "GET /congrats.html HTTP/1.0\r\nConnection: Close\r\n\r\n" ; // const char msg[] = "Hello World\r\n" ; if ( @@ -117,8 +117,7 @@ if (n >= 0) { buf[n] = 0; printf("%s", buf); - } else - err_sys("CyaSSL_read failed"); + } else break ; } while(n > 0) ; puts("=== === === ===") ; /*** SSL CyaSSL_free(ssl) ; ***/ @@ -126,3 +125,14 @@ /*** SSL CyaSSL_CTX_free(ctx) ; ***/ eth.disconnect(); } + +main() +{ + +#define STACK_SIZE 20000 + Thread t(net_main, NULL, osPriorityNormal, STACK_SIZE); + + while (true) { + Thread::wait(1000); + } +}