lagdawg
02-23-2004, 10:12 PM
I am writing a client server program in c and am having trouble getting the client to connect to the server.
My error occurs in the server when attempting to accept a connection from a client.
server: accept: Invalid argument
//* server.c *//
socklen_t socklen;
if((new_s = accept(soc, (SA *) &clnt_addr, &socklen)) < 0) {
perror("server: accept");
close(soc);
exit(1);
}
//* client.c *//
soc = socket(AF_INET, SOCK_STREAM, 0)) < 0);
connect(soc, (SA *) &sin, sizeof(sin)) < 0);
Can anyone shed some light on this problem?
My error occurs in the server when attempting to accept a connection from a client.
server: accept: Invalid argument
//* server.c *//
socklen_t socklen;
if((new_s = accept(soc, (SA *) &clnt_addr, &socklen)) < 0) {
perror("server: accept");
close(soc);
exit(1);
}
//* client.c *//
soc = socket(AF_INET, SOCK_STREAM, 0)) < 0);
connect(soc, (SA *) &sin, sizeof(sin)) < 0);
Can anyone shed some light on this problem?