Execution Problem with socket

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 ..!!:confused:

What does the network between these two different machines look like?

A Lan network that connects several systems using ethernet cable cat 5 cable ..!

---------- Post updated Apr 1st, 2012 at 08:40 AM ---------- Previous update was Mar 31st, 2012 at 02:21 PM ----------

Hello .!Please Any One Help me..!

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.