From e85213689e33783eb6ad3233efa506318f0656ff Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Tue, 13 Mar 2012 17:38:33 +0100 Subject: [PATCH] TCP_STREAM_SOCKET: added `try_ready_for_reading' which is the same as `ready_for_reading' but without any timeout --- library/tcp_stream_socket.e | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/library/tcp_stream_socket.e b/library/tcp_stream_socket.e index 797cd5e6..308dfebe 100644 --- a/library/tcp_stream_socket.e +++ b/library/tcp_stream_socket.e @@ -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)"