aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/fhandler.h
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2002-07-06 11:16:07 +0000
committerCorinna Vinschen <corinna@vinschen.de>2002-07-06 11:16:07 +0000
commit6bb769efa0a993613e311a586362dbd780a41ca5 (patch)
tree7a66c185a404be0d432c8836cc3e8a79761a2bf5 /winsup/cygwin/fhandler.h
parent6201dd26a65c2db4cb8f1e902c0dffcde4dfdaef (diff)
downloadnewlib-6bb769efa0a993613e311a586362dbd780a41ca5.zip
newlib-6bb769efa0a993613e311a586362dbd780a41ca5.tar.gz
newlib-6bb769efa0a993613e311a586362dbd780a41ca5.tar.bz2
* fhandler.h (fhandler_socket::is_unconnected): Constify.
(fhandler_socket::is_connect_pending): Ditto. (fhandler_socket::is_connected): Ditto. (fhandler_socket::set_connect_state): New method. (struct select_record): Add member `except_on_write'. (select_record::select_record): Initialize all bool values to `false'. * fhandler_socket.cc: Use set_connect_state() method throughout. (fhandler_socket::connect): Set state always to connected if connection isn't pending. * net.cc (cygwin_getsockopt): Revert erroneous previous patch. * select.cc (set_bits): Check for `except_on_write'. Set fd in write_fds if set. Set connect state to connected if fd has been returned by WINSOCK_SELECT. (peek_socket): Check for `except_on_write'. (start_thread_socket): Ditto. (fhandler_socket::select_write): Don't set `write_ready' if connect is pending. Set `except_on_write' if connect is pending.
Diffstat (limited to 'winsup/cygwin/fhandler.h')
-rw-r--r--winsup/cygwin/fhandler.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 980957a..164a892 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -385,9 +385,10 @@ class fhandler_socket: public fhandler_base
void set_shutdown_read () {FHSETF (SHUTRD);}
void set_shutdown_write () {FHSETF (SHUTWR);}
- bool is_unconnected () {return had_connect_or_listen == UNCONNECTED;}
- bool is_connect_pending () {return had_connect_or_listen == CONNECT_PENDING;}
- bool is_connected () {return had_connect_or_listen == CONNECTED;}
+ bool is_unconnected () const {return had_connect_or_listen == UNCONNECTED;}
+ bool is_connect_pending () const {return had_connect_or_listen == CONNECT_PENDING;}
+ bool is_connected () const {return had_connect_or_listen == CONNECTED;}
+ void set_connect_state (int newstate) { had_connect_or_listen = newstate; }
int bind (const struct sockaddr *name, int namelen);
int connect (const struct sockaddr *name, int namelen);
@@ -1185,6 +1186,7 @@ struct select_record
bool windows_handle;
bool read_ready, write_ready, except_ready;
bool read_selected, write_selected, except_selected;
+ bool except_on_write;
int (*startup) (select_record *me, class select_stuff *stuff);
int (*peek) (select_record *, bool);
int (*verify) (select_record *me, fd_set *readfds, fd_set *writefds,
@@ -1193,9 +1195,10 @@ struct select_record
struct select_record *next;
select_record (fhandler_base *in_fh = NULL) : fd (0), h (NULL),
- fh (in_fh), saw_error (0), windows_handle (0),
- read_ready (0), write_ready (0), except_ready (0),
- read_selected (0), write_selected (0), except_selected (0),
+ fh (in_fh), saw_error (false), windows_handle (false),
+ read_ready (false), write_ready (false), except_ready (false),
+ read_selected (false), write_selected (false),
+ except_selected (false), except_on_write (false),
startup (NULL), peek (NULL), verify (NULL), cleanup (NULL),
next (NULL) {}
};