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.

TI6678 NTK client disconnect detection

Hi.

I use TMDSEVM6678LE and trying to build a network application.

I found client sample project (from C:\ti\mcsdk_2_01_02_05\examples\ndk\client) and build and it works well.

The project use simple echo server routine named ndtask_tcp_echo() and when the remote echo client disconnect, recvnc returns 0 and fdError return error code. (This is fine.)

But when I remove recvnc function and just send simple "hello" message like below code, send function nor fdError never returns error code.

while (TRUE) {
  i = send(hSock, "hello\r\n", strlen("hello\r\n"), 0);
  System_printf("sent %d %d\n", i, fdError() );
  if ( i <= 0 ) {
    System_printf ("Send connection Closed\n");
    break;
  }
  platform_delay(100 * 1000);
}

The reason I mention this is I want implement some kind of streaming server which client simply connect to server(without send request) and server send streaming data to client until client disconnect the session.

For above situation, server cannot detect when the client disconnect session.

So, I want to know how server can detect client connection status without recv function call.

Regards,

Brian.

  • Brian,

    It is not peripheral related. But I can suggest you when use the server and client setup, follow the sequence.
    1. Server program running on PC
    2. Client program running on board
    3. Connect the client using board IP if this is alive or pinging
    4. Once connected the client, use the some enum like STATUS_CONNECTED
    5. Send this value using udp program on running the Server application
    Is it understandable to you.