-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rsockets: Use service thread to accept connections
Rsockets currently uses the application thread to drive the progress state of new connections. However, some applications expect that new connections can be established without the application taking specific actions. For example, some apps do this sequence: s = socket(); c = socket(); fcntl(s, O_NONBLOCK); listen(s); connect(c); a = accept(s); In rsockets, this hangs at connect because nothing processes the incoming connection request. This problem was reported when integrating rsockets in the Java Development Kit. To better support the socket semantic, move the processing of connection requests to a service thread. We setup a socketpair on any listening socket. After a connection has been established, the listening socket is notified via the socketpair. With this change, a single thread app can connect to itself and transfer data. Signed-off-by: Sean Hefty <sean.hefty@intel.com>
- Loading branch information
Showing
1 changed file
with
148 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters