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

LEDSwitch Client did not work correctly

the example LEDSwitch Client for MCB2300 did not work correctly in my MCB2378 board.it can be ping,but i can not connect to it by TCPServer.

switch (protocol) {
      case TCP:
         socket_tcp = tcp_get_socket (TCP_TYPE_CLIENT, 0, 10, tcp_callback);
                 if (socket_tcp != 0)
                 { tcp_connect (socket_tcp, Rem_IP, PORT_NUM, 0);}
         break;

while (1) {
      timer_poll ();
      main_TcpNet ();
}

i checked and called tcp_get_state(socket_tcp); ,but it return TCP_STATE_SYN_SENT (value = 4)always.How can i do that return correctly value TCP_STATA_CONNECT?

Parents
  • do you remember how a TCP/IP connection is built?

    1. server sends SYN
    2. client returns ACK + SYN
    3. server replies by ACK
    4. connection established.

    assuming the PC is the takes the initiative, you seem to be stuck at stage 3 - your server never replied with an ACK. Did you try to monitor the connection with a TCP sniffer?

Reply
  • do you remember how a TCP/IP connection is built?

    1. server sends SYN
    2. client returns ACK + SYN
    3. server replies by ACK
    4. connection established.

    assuming the PC is the takes the initiative, you seem to be stuck at stage 3 - your server never replied with an ACK. Did you try to monitor the connection with a TCP sniffer?

Children