Hi,
    The following code snippet is causing errors during compilation. For
some reason the structure sockaddr_in is not being supported, (the compiler
reports size of my_addr not known at line 10) whereas this seems to be
defined in socket.h !
Can anybody help ?

Riddhi


    #include <string.h>
    #include <sys/types.h>
    #include <sys/socket.h>

    #define MYPORT 3490

    main()
    {
        int sockfd;
        struct sockaddr_in my_addr;  <----------- 'Offending' line

        sockfd = socket(AF_INET, SOCK_STREAM, 0);
        my_addr.sin_family = AF_INET;     /* host byte order */
        my_addr.sin_port = htons(MYPORT); /* short, network byte order */
        my_addr.sin_addr.s_addr = inet_addr("132.241.5.10");
        bzero(&(my_addr.sin_zero), 8);    /* zero the rest of the struct */
      bind(sockfd, (struct sockaddr *)&my_addr, sizeof(struct sockaddr));
     }



--
To unsubscribe, send mail to [EMAIL PROTECTED] with the body
"unsubscribe ilug-cal" and an empty subject line.
FAQ: http://www.ilug-cal.org/faq/listfaq.html

Reply via email to