Avoid windows firewall complains about tcp usage
Submitted by Ralf Habacker
Assigned to D-Bus Maintainers
Running dbus on windows often raises the firewall to request permissions for opening tcp ports. If a user do not allow this, dbus will be nonfunctional.
A way to solve this issue may be to use named pipes on windows, for which several implementation examples are available:
1.1. server part using Overlapped I/O (http://en.wikipedia.org/wiki/Overlapped_I/O) http://msdn.microsoft.com/en-us/library/windows/desktop/aa365603%28v=vs.85%29.aspx
1.2. server part using threading http://msdn.microsoft.com/en-us/library/windows/desktop/aa365588%28v=vs.85%29.aspx
1.3. server using Completion routines (using overlapped i/o) http://msdn.microsoft.com/en-us/library/windows/desktop/aa365601%28v=vs.85%29.aspx
1.5.1 Qt named pipe server (QLocalServer) http://qt-project.org/doc/qt-5.0/qtnetwork/qlocalserver.html https://qt.gitorious.org/qt/qt/source/0315971ee951e9abe7f288564ddf2e81aeed1fd8:src/network/socket/qlocalserver.h
1.5.2 Qt named pipe client (QLocalSocket) qt-project.org/doc/qt-5.0/qtnetwork/qlocalsocket.html https://qt.gitorious.org/qt/qt/source/0315971ee951e9abe7f288564ddf2e81aeed1fd8:src/network/socket/qlocalclient.h
So in general it seems to doable.
In general looking at the example 1.5 I would say that at a minimum the following stuff is required:
client 2.1 structure to hold variables of the client instance 2.2 functions
- connect to a pipe
- disconnect from a pipe
- return connection state
- write data to pipe
- receive data from pipe
- check write state of pipe
- check read state of pipe
- error handling
server 3.1 structure to hold variables of the server instance 3.2 functions for the server part
- create a server instance
- destroy a server instance
- start listening
- stop listening
- return listening state
- handle new connections
- functions from the client part
open questions 4.1. At http://cgit.freedesktop.org/dbus/dbus/tree/README.win there has been stated that it would require a "bigger change to the dbus code", which lead to the question, what kind of changes are required to be able to make an implementation of named pipe support on windows ?
4.2. Which one of the available implementation would be the best choice to use in the dbus code ?