#14209: Implement new option SocksNamedPipe for Windows users --------------------------+------------------------------ Reporter: anon | Owner: Type: enhancement | Status: new Priority: Medium | Milestone: Tor: 0.2.??? Component: Core Tor/Tor | Version: Severity: Normal | Resolution: Keywords: tor-client | Actual Points: Parent ID: | Points: Reviewer: | Sponsor: --------------------------+------------------------------ Changes (by xeonchen):
* severity: => Normal Comment: per nickm: ---- I'd suggest an extra thread and event loop to process Windows handles. You'll need to communicate with the main thread; look at workqueue.c to get some idea of how we do that now, though you'd probably want a different implementation. Avoid sharing structures whenever possible. To keep as much shared implementation as possible, you might do it like this: * enable threadsafe mode when initializing libevent. * Add handle-based versions of read_to_buf / flush_buf. Use them as appropriate. * Allow a connection_t to optionally have a handle instead of a socket. * When constructing the event objects for the handle, do not pass in a file descriptor. Instead, pass a file descriptor of -1. * From the worker thread, use event_active() to make those event objects active when the handles are ready for read/write. (This is why libevent needs to be running with thread safety enabled.) * Now all you'll need is some way for the main thread to tell the worker thread about new handles, closed handles, and which of the handles should be reading/writing. ---- -- Ticket URL: <https://trac.torproject.org/projects/tor/ticket/14209#comment:4> Tor Bug Tracker & Wiki <https://trac.torproject.org/> The Tor Project: anonymity online _______________________________________________ tor-bugs mailing list tor-bugs@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs