<div dir="ltr">Hi,<div><br></div><div>If setup a socket with:</div><div><br></div><div> socket:setopt(Socket, ip, recverr, true)</div><div><br></div><div>If then started a asynchronous recvmsg with:<br><br> {select, SelectInfo} = socket:recvfrom(Socket, 0, [], nowait)<br></div><div><br></div><div>When now something arrives in the error queue, I'll get a select info message with:</div><div><br></div><div> {'$socket', Socket, select, SelectInfo}<br></div><div><br></div><div>The problem is, nothing in there tells me to read from the error queue. The underlying OS poll/epoll call would have this information, but it is lost in the Erlang message.</div><div><br></div><div>When I now try to read from the socket with:</div><div><br></div><div> socket:recvfrom(Socket, 0, [], nowait)<br></div><div><br></div><div>all I get is another `{select, SelectInfo}` tuple, followed by another `{'$socket', Socket, select, SelectInfo}` messages.</div><div>This can actually end up in an endless busy loop.</div><div><br></div><div>To actually clear this I would to do a:<br></div><div><br></div><div> socket:recvmsg(Socket, [errqueue], nowait)</div><div><br></div><div>On an POSIX socket, I would have to actually poll for POLLIN | POLLERR to get a similar behavior. But the return of the poll would tell me whether it was POLLIN or POLLERR (similar for epoll).</div><div>For the Erlang API it might sense to always poll for both conditions, but we then should get an indication what exactly it was.</div><div><br></div><div>Would it be possible to change the $socket message to something like:</div><div><br></div><div> {'$socket', Socket, error, SelectInfo}<br></div><div><br></div><div>for POLLERR/EPOLLERR ???</div><div><br></div><div>Regards</div><div>Andreas<br></div><div>--<br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><p><span style="font-family:verdana,geneva,sans-serif;font-size:10pt">Andreas Schultz<br></span></p>
</div></div></div>