TCP_STREAM_SOCKET: added try_ready_for_reading' which is the same as ready_for_reading' but without any timeout

This commit is contained in:
Jocelyn Fiat
2012-03-13 17:38:33 +01:00
parent ab38345c25
commit e85213689e

View File

@@ -40,6 +40,19 @@ feature -- Output
put_managed_pointer (ext.managed_data, 0, s.count)
end
feature -- Status report
try_ready_for_reading: BOOLEAN
-- Is data available for reading from the socket right now?
require
socket_exists: exists
local
retval: INTEGER
do
retval := c_select_poll_with_timeout (descriptor, True, 0)
Result := (retval > 0)
end
note
copyright: "2011-2011, Javier Velilla and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"