This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to get data in TCP client mode

Other Parts Discussed in Thread: CC3200

Hi

How are you?

I want to know how to get data in TCP client mode.

In CC3200, TCP Client Mode, First, device connected to server and device sent some packets to server.

After Server get data from client(device), server will send some ack packet to client.

How to get server data in client?    polling? or interrupt ?

When or Where does device run the sl_Recv() ?

code (Send code) is belows

        iStatus = sl_Send(iSockID, &test_req, sizeof(test_req), 0 );     // Send Data

        if( iStatus < 0 )
        {
           sl_Close(iSockID);
           ASSERT_ON_ERROR(SEND_ERROR);
        }
        else Report("Sent packets successfully\n\r");

        iStatus = sl_Recv(iSockID, g_cBsdBuf, sTestBufLen, 0 );

But last time iStatus is always 0. 

How to know whether server sent data ?

and When or Where does device run the sl_Recv() ?

Thank you for reading this article :)

  • Hi,

    Can you please confirm which device you are using?

    Regards,
    Gigi Joseph.
  • Hi Gigi!

    Thank you for your concern !

    I just make simple sensor device.

    Server (which is computer) waits for this device.  

    This device will connect to server and send some data to server.

    and server will send ACK Packet to this device.

    but I don't know how to receive this server data.

    in source code, where do i put sl_recv() code. ?   

    if i put sl_recv() in infinite_loop in main, maybe alway ready to recv.

    what is the trigger about signal that this device receives the packet ?

    Thank you  :)

  • Hi Dennis,

    I'm sorry, I just want to know if your device is CC3000 or CC3200. If it is CC3200, there is a different e2e forum for the same.
    Please clarify.

    Regards,
    Gigi Joseph.