View Single Post
  #2 (permalink)  
Old December 17th, 2011, 12:42 PM
franford franford is offline
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Dec 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help!

Hi Octavius, did you manage to resolve this and if so, how? Thanks, Frank

Originally Posted by octavius View Post
i am new to socket programming...when i was trying the code given in the book for client-server model using socket programming, i faced a broken pipe error in the server program

int main()
{ int sockfd;
        int len;
        struct sockaddr_un address;
        int result;
        char ch='A';



        result=connect(sockfd,(struct sockaddr *)&address,len);
        { perror("oops:client");

        printf("char from server=%c\n",ch);

int main()
        int server_sockfd,client_sockfd;
        int server_len,client_len;
        struct sockaddr_un server_address;
        struct sockaddr_un client_address;
        char ch;


        bind(server_sockfd,(struct sockaddr *)&server_address,server_len);
        { printf("server waiting\n");
                client_sockfd=accept(server_sockfd,(struct sockaddr *)&client_address,(socklen_t *)&client_len);

when i run server in the background i get
server waiting

after this when i run client i get
[1]+ Broken pipe ./server

i am not being able to figure the error...plz help