Accepting Sockets with accept()
If i didnt use new_socket what would i use to send and recv from?
if ((new_socket = accept(master_socket, (struct sockaddr *)&address, sizeof(address);/*&addrlen*/))<0)
I mean how does accept work? Do i have to make new_socket equal accept?
or can i just send information to mastersocket and exclude the over bearing
oh one more thing because i havent compiled my program yet I was wondering if
sizeof(address) would take the place of addrlen=sizeof(address) as I posted above.
You did understand the question right?
I just wanted to mkae sure you understand the question and gave me the correct answer. if i use accept without using new_socket as the intiger then i cant send to mastersocket instead of sending to new_socket.
By the way thanks for you help.
and hows this lookf so far?
int activity, user;
int maxclients = 700;
fatal("Creating mastersocket, AF_INET SOCK
struct sockaddr_in address;
address.sin_family = AF_INET;
address.sin_addr.s_addr = INADDR_ANY;
address.sin_port = htons(port);
/*Binding a socket callled mastersocket */
if(bind(mastersocket,(struct sockaddr *)&ad
fatal("Binding mastersocket, AF_INET SOCK_
/* Listening to mastersocket */
if(listen(mastersocket, 3) == -1)
fatal("Listening to mastersocket, AF_INET
fcntl(mastersocket, F_SETFL, FNDELAY);