Hi all

I face a problem with getting data from the SerialForwarder. I wrote a client 
application using C under Linux. The client connects to the SerialForwarder but 
it doesn't receive  the data. Following is part of the code:
        addr.sin_port = htons(9001); /* set the port # */

        addr.sin_addr.s_addr = *(long*)host->h_addr_list[0]; /* set the addr */

        conn = connect(sd, (struct sockaddr*)&addr, sizeof(addr)); /* connect! 
*/

        if (conn == -1)

        {

            printf("Can't connect. Error no: %i\n", errno);

            exit(0);

        }

        char s[20];

        int rcd;


        while ((rcd = recv(sd, s, 20, 0)) != 0)

            printf("%s\n", s); 

Is there something missing from this code?



Regards

islheg
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to