This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to send data in TCP_Server

I am using MCB1700 as TCP server and I can received data from PC client.
But I can not send data back to the PC client while the TCP is still connected. Is there any one who has experience to do that ?

In the /TCPnet/LEDSwitch example, I managed to receive data from PC client but I don't know how to send the response/data back to the PC client? which function can be used ? Is there any one who has example ?

Parents
  • use tcp_send function, dont use it inside the callback and make sure that you are using the tcp_get_buf function before sending data:

    ucSendbuf = tcp_get_buf (10);
    ....
    ..
    populate ucSendbuf byte by byte
    ..
    ....
    tcp_send (tcp_soc, ucSendbuf, 10);

Reply
  • use tcp_send function, dont use it inside the callback and make sure that you are using the tcp_get_buf function before sending data:

    ucSendbuf = tcp_get_buf (10);
    ....
    ..
    populate ucSendbuf byte by byte
    ..
    ....
    tcp_send (tcp_soc, ucSendbuf, 10);

Children