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.

Detection and handling of tcpip related problems

Hi, 

I made a simple application that opens a socket, connects to a tcpip server, then answers to messages from the server - it works fine.

Now I want to cover problems that may happen - I would like to know how to detect them (I guess hooks) and what is the handling.

I can think now on two possible problems , please let me know if there are more:

1) disconnection from server

2) socket closed (can this happen?)

Thanks in advance!

Board: EVMC6748 (I am using the TMS320C6748 DSP).

I am connected using the ethernet port to my router.

ccs: 5.4.0.00091

bios: 6_35_01_29

pspdrivers: 01_30_01

nsp: nsp_1_10_02_09

ndk: ndk_2_22_03_20

xdctools: 3_25_00_48

xgconf:  I selected "global network settings", "http", "tcp", "ip" and enable IPv6.

  • Gaby Levy,

    When you disconnect the TCP socket, should be close the socket handle using fdClose.
    SOCKET slistenData = INVALID_SOCKET; //declaration

    If the connection got an error or disconnect, close the socket.
    fdClose( slistenCmd );
    slistenCmd = INVALID_SOCKET;
      
    You can find the EchoTCP in the section "Example Code" at TMS320C6000 Network Developer's Kit (NDK) Software User's Guide (spru523)
    And also refer the section "Server Daemon Example" at TMS320C6000 Network Developer's Kit (NDK) Software Programmer's Reference Guide (spru524)