pid = fork();
if (pid < 0){ error("Error: Cannot create new proces"); return EXIT_FAILURE;}
if (pid == 0) {
i++;
close(sockfd);
dostuff(newsockfd,i+pid);
close(newsockfd);...
Type: Posts; User: Morbo
pid = fork();
if (pid < 0){ error("Error: Cannot create new proces"); return EXIT_FAILURE;}
if (pid == 0) {
i++;
close(sockfd);
dostuff(newsockfd,i+pid);
close(newsockfd);...
I am now testing the raw sockets thing. Hope it works. Also I think I just might change my server to respond a broadcast and then sending his ip and port to the client that send the broardcast.
...
I made a little socket serverthat works (tested with telnet) and now I am starting to code myself a client to interact with the server.
The problem:
multiple pc can host multiple servers with...
int main(int argc, char *argv[]) {
int test;
test = 0;
while (1) {
test++;
}
test--;
printf("%d",test);
return 0;