GLib-WARNING **: poll(2) failed due to: Invalid argument.
I am writing a server application, but have run into a problem.
When I reach about 850 connection, the program jumps to using a lot of CPU, and I get a deluge of the following message:
(process:9804): GLib-WARNING **: poll(2) failed due to: Invalid argument.
I've no idea where that could be coming from, does anyone know what might actually cause that?
Re: GLib-WARNING **: poll(2) failed due to: Invalid argument.
Could be that a large number of sockets is causing this. The amount of sockets you may open (and handle) at the same time is often limited. Maybe you reached some limit.
Re: GLib-WARNING **: poll(2) failed due to: Invalid argument.
It does seem to be that. When I compiled and ran it on another machine that had a customized kernel to allow more Sockets, I didn't run into the same problem.
So how can I detect this problem is occurring and have my program take steps to prevent this crash?
QTcpServer does not seem to have any onError signals :-(
Re: GLib-WARNING **: poll(2) failed due to: Invalid argument.
Quote:
Originally Posted by
December
So how can I detect this problem is occurring and have my program take steps to prevent this crash?
As for Linux, you can query /proc or /sys for the number of allowed file descriptors per process. As for other OSes, I have no idea. Do you really need such a large number of sockets?
Quote:
QTcpServer does not seem to have any onError signals :-(
You can access the error from the regular socket (See QAbstractSocket::error ()).
Re: GLib-WARNING **: poll(2) failed due to: Invalid argument.
I am getting the same error "(process:2795): GLib-WARNING **: poll(2) failed due to: Invalid argument." , when the connection exceeds 550.
Is the "Kernel rebuilding by allowing more sockets" only solves the problem? or any other way to solve this?
Note:
I am running this in Slackware.