My comment in 1b0230e4df was misleading, even if
doing this for Unix only, if we had done it as I was first thinking, we would
have needed to pass sockets between processes. But we won't, we will instead
keep all the connections to the clients in the same master process, and pass
on the WebSocketg protocol as such to child processes. That way the child
processes can go away when idle, or crash, without the connections
breaking. Or something.
the '_addTile' method now also handles tiles comming from a websocket.
Tiles are no longer added in one batch as they are added when received.
Added twip to pixel and pixel to twip convertor methods.
1 twip = 15 px
'onopen' and 'onmessage' events are handled
in src/layer/tile/TileLayer.js
Tile data is received as an ArrayBuffer which contains a string message
followed by a new line and then by the actual PNG data. The PNG data
is encoded in base-64 in order to be displayed.
Will be needed if we want loolwsd to run on Windows. Then we will have one
process receiving the connections from WebSocket clients and sending the
accepted connection sockets to child processes thatr might be already running,
either because they have been "pre-forked", or because of a collaboration
scenario where new clients join a session working on a document.
But initially we will write this as if for Unix only, so development of this
migratory socket stuff is paused for now. (And it isn't even clear whether the
API design so far is a good idea and elegantly implementable.)
Having a 'close' would mean being able to do a new 'open', too, which
introduces unneeded complexity, at least at this stage.
Just start a fresh WebSocket connection for each document.
Use a larger buffer in the TestOutput class to handle a bit larger tiles. Too
bad that the current Poco::WebSocket::receiveFrame() takes a fixed size
buffer. (I will submit a patch to Poco for a receiveFrame() that takes a
dynamically resizable buffer and handles whatever size frame the other side
sends.)