Hello,
I've an application that uses pth to process different
kinds of events. A thread tries to retrieve some information
from a server via a TCP connection, and sends a request
for that purpose. Then it waits for the response using
the following code:
while (1) {
fev = pth_event(PTH_EVENT_FD | PTH_UNTIL_FD_READABLE, sock);
tev = pth_event(PTH_EVENT_TIME, pth_timeout(timeout.tv_sec,
timeout.tv_usec));
ev = pth_event_concat(tev, fev, NULL);
/* do we have something on the socket? */
pth_wait(ev);
if (pth_event_occurred(tev)) {
/* now we have a timeout, and give up */
return -1;
}
if (pth_event_occurred(fev)) {
/* yes, something happened on the socket */
bytes = recv(sock, (char *)&buffer[bytesread],
length - bytesread, MSG_NOSIGNAL);
.......
}
}
But although the server returns the data, and apparently the pth
library also sees the response, the pth_event_occured(fev) (which
should occur when data arrives on the socket), never happens.
This same code works fine on OpenSUSE 10.3, but it fails on
Red Hat EL 5 (kernel 2.6.18). Any suggestions what might have
caused this are welcome.
Best regards
Andreas Mueller
--
Prof. Dr. Andreas Mueller
[EMAIL PROTECTED]
Bubental 53, 8852 Altendorf
Voice: +41 55 4621481 Fax/Data: +41 55 4621485
______________________________________________________________________
GNU Portable Threads (Pth) http://www.gnu.org/software/pth/
Development Site http://www.ossp.org/pkg/lib/pth/
Distribution Files ftp://ftp.gnu.org/gnu/pth/
Distribution Snapshots ftp://ftp.ossp.org/pkg/lib/pth/
User Support Mailing List [email protected]
Automated List Manager (Majordomo) [EMAIL PROTECTED]