Hi
My socket program is to communicate between the two systems connected with lan. Always i am getting an error saying bind value is -1 or not connected. ..If i run both the server and client programs in the same machine in two diff terminals they are working but they are not working between two systems .Please help me..!
My Operating system is Fedora 15
and the socket code is
struct sockaddr_in ser;
sd=socket(AF_INET,SOCK_STREAM,0);
if(sd<0)
printf("SOCKET NOT CREATED\n");
bzero(&ser,sizeof(struct sockaddr_in));
ser.sin_family=AF_INET;
ser.sin_port=htons(1012);
inet_aton("192.168.10.1",&ser.sin_addr);
int b=bind(sd,(struct sockaddr *)&ser,sizeof(ser));
printf("BIND VALUE:%d\n",b);
listen(sd,5);
... continues...!
When I am running on the same machine the code differs in the line
inet_aton("localhost",&ser.sin_addr);
:wall:Please Help me ..!!