ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
my appologies, that was a but short there... but if you want help from others then you need to provide information for them to work with. you have said nothing to actaully give any idea what is meant to happen in a correct scenario, let alone what is going wrong. you have to help yourself if you expect otehrs to do the same.
The code is short and simple. To describe it in words will add more fog than clear existing one. The problem I have is that server gets only one message from the single client and I don't know how to make server respond every time. Please, look into the code it is really simple. There is something very small but very important what I don't know that creates this problem. http://www.uwsg.iu.edu/hypermail/lin...06.0/0189.html
The code is short and simple. To describe it in words will add more fog than clear existing one. The problem I have is that server gets only one message from the single client and I don't know how to make server respond every time. Please, look into the code it is really simple. There is something very small but very important what I don't know that creates this problem. http://www.uwsg.iu.edu/hypermail/lin...06.0/0189.html
you have wrong sigaction code (mysig(int sig)).
you try reading from closed socket after first client.
your global variable 'c' must be zero after job.
insert something like
close(c);
c = 0;
It will be
if (ret < 0) {
perror("read()");
return;
}
fprintf(stderr, "received %d bytes <%s>\n", ret, buf);
close(c); // <----- see here
c = 0; // <-----
return;
}
...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.