You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Damir Dezeljin <pr...@mbss.org> on 2005/03/16 09:19:04 UTC

pollset_poll() on OS400

Hi.

I'm using apr sockets to establish an STREAM, AF_INET connection between
a client and server. After accepting the connection, I start polling for
incoming data using apr_pollset_poll() - I'm looking for IN, HUP and ERR
events. Nearly all is working fine (as expected) on Linux. However when
compiling the application on OS400, the poll() returns immediately with one
file descriptor signalled, however the rtevents variable is empty (0) -
BTW: apr_pollset_poll() returns APR_SUCCESS. How is this possible?

I'm also wondering why an HUP event isn't signaled uppon the socket is
closed on the client side (the IN event is signalled). Is this normal?

After some testing I found out that creating a new apr_pool for
socket and polling usage partially solves the problem.

BTW: My application is a multi threaded application (using apr_threads). Is
it possible that this is the reason of my problems?

Thanks,
Dezo


Re: pollset_poll() on OS400

Posted by Damir Dezeljin <pr...@mbss.org>.
Hi.

> I found out that apr_pollset_poll() returns an APR_POLLOUT (0x004) event
> even if I didn't request it. Any hint why this is happening?
The problem was caused by compliation flag ENUM=*INT .

Explanation:
Enums length on OS400 depends on number of defined values unless ENUM=*INT
is defined.
Unfortunately I need 4 byte enums in other object files :(


Regards,
Dezo


Re: pollset_poll() on OS400

Posted by Damir Dezeljin <pr...@mbss.org>.
Hi.


I found out that apr_pollset_poll() returns an APR_POLLOUT (0x004) event
even if I didn't request it. Any hint why this is happening?


A snip from my code:
----
apr_pollfd_t    sock_pollfd;
...
sock_pollfd.desc_type   = APR_POLL_SOCKET;
sock_pollfd.reqevents   = APR_POLLIN | APR_POLLERR |APR_POLLHUP;
sock_pollfd.desc.s      = conn_p;
sock_pollfd.client_data = conn_p;
...
arv = apr_pollset_poll(
    pollset_p,
    -1,
    &actPollFdNo,
    (const apr_pollfd_t **) &actPollFd_p);
APR_CHECK_ERR(arv);
....
----

Best regards,
Dezo