(accidentally sent... continue here)
The Server Parameter is used to connect Process A pin (named xxxxxx1 in the Filesystem) to Process B's pout. The second Pipe (named xxxxxx2) is connected to A's pout and B's pin. The creator of the channel is (normaly, expect for unit tests) the server (using createChannel) and the other Process is the client (using getChannel).
The same applies to the reverse channel, named xxxxxx3 and xxxxxx4.
The "normal" or "default" channel is used to send Messages created e.g. by the Library (maybe tab.navigateTo()), the reverse Channel is used for Messages for the same channel (in this case: the tab) but created by berkelium host process. This can be onReady or onPaint.
A IPC Channel is a communication link between the library and the host process, "default" channel is currently used by Instance, Window and Tab, the reverse Channel is mapped to WindowDelegate and TabDelegate.
I hope you understand me, please ask if not.
Because Windows Named Pipes (I also planned to use them) can read and write (I would have previously read the instructions..) at the same time it makes no sense to Map the Pipe Class to both windows and unix pipes at the same time.
I have rewritten the IPC Code during the last week (the unit tests don't work currently, but i commited everything that you can see the changes)
One Problem is that every Pipe needs a file handle and there are limited to 1024 by default for Linux Users.
I created a new ChannelGroup (using the four pipes like Channel before). But all Channels of this Channel Group shares the same Pipes, because of this there are only four file handels (+two for stdout and stderr) needed for every host instance started by the library. (The old implementation needed [count(window + tab) * 4 + 4] Pipes, this will make it impossible to open much windows or tabs)
I think we should rename Pipe to PosixUniPipe [do you know a better name?] (for Linux and MacOS) and create a new Pipe. The new Pipe can be implemented using WindowsNamedPipe for windows and a new PosixPipe (using two PosixUniPipes)
The ChannelGroup must then be refactored to use the new Pipe, but this should be more or less easy.
Currently both berkelium library and host are single threaded (in the scope of berkelium, there are other chromium threads in the host and there can be other user threads on the library part)
Because of this it is required to call runtime.update() (like the old berkelium version). The will read all available data from all pipes and pass the decoded messages to the matching Channels.
Examples for this in the library code:
Another implementation (for Tab) is here:
[It makes sense to pass the Message directly to internalUpdate(), i already planned to change this]
More interesting is the same implementation on the host side:
Here (already onDataReady with Message, not internalUpdate) the decoded Message is passed to onCreateWindow or exitHost.
This are examples for the "default" Channel, the reverse channel is not really used yet. An (not realy good) example is here:
and
I hope this helps to understand my code. My first priority currently is to create a first usable Version. Because I don't have too much time there is not good documentation yet :-(
If you have any questions or if you need help please contact me.
Best regards
Dennis