Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2016-01-24 Thread Denis Kozlov
On 22/01/2016 22:33, Denis Kozlov wrote: so the next patch will be use this common "simpleipc.inc" on all Windows platforms (AllWindowsOSes). Patch attached here: http://bugs.freepascal.org/view.php?id=29496 Summary of changes: 1) Moved "src/win/simpleipc.inc" to "src/winall/simpleipc.inc" 2)

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2016-01-22 Thread Denis Kozlov
On 16/01/2016 21:43, Denis Kozlov wrote: In regards to merging "wince" and "win" implementations of SimpleIPC. The only real difference is the use of Wide vs Ansi types and functions of WinAPI. Currently, "win32" and "win64" platforms use A versions, while "wince" uses W versions. I have

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2016-01-22 Thread Michael Van Canneyt
On Fri, 22 Jan 2016, Denis Kozlov wrote: On 16/01/2016 21:43, Denis Kozlov wrote: In regards to merging "wince" and "win" implementations of SimpleIPC. The only real difference is the use of Wide vs Ansi types and functions of WinAPI. Currently, "win32" and "win64" platforms use A

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2016-01-16 Thread Denis Kozlov
In regards to merging "wince" and "win" implementations of SimpleIPC. The only real difference is the use of Wide vs Ansi types and functions of WinAPI. Currently, "win32" and "win64" platforms use A versions, while "wince" uses W versions. Since FPC trunk no longer supports Win9x

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2016-01-16 Thread Michael Van Canneyt
On Sat, 16 Jan 2016, Denis Kozlov wrote: In regards to merging "wince" and "win" implementations of SimpleIPC. The only real difference is the use of Wide vs Ansi types and functions of WinAPI. Currently, "win32" and "win64" platforms use A versions, while "wince" uses W versions. Since

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2016-01-05 Thread Denis Kozlov
On 5 January 2016 at 12:39, Michael Van Canneyt wrote: > I was in fact waiting for this part, rather than applying the patch as it > is. > But if you prefer we can do it in steps ? > I prefer to do this in steps, easier to control changes. Bug report with same patch files:

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2016-01-05 Thread Michael Van Canneyt
On Tue, 5 Jan 2016, Denis Kozlov wrote: On 5 January 2016 at 12:39, Michael Van Canneyt wrote: I was in fact waiting for this part, rather than applying the patch as it is. But if you prefer we can do it in steps ? I prefer to do this in steps, easier to control changes. Bug report with

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2016-01-04 Thread Denis Kozlov
Did anyone have a chance to review the changes to SimpleIPC? Patches are attached in the previous message. Proposed next steps: 1) If everyone is happy - commit changes (should I create a bug report in mantis?). 2) I can merge "wince" with "win" implementation since they are identical except for

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2015-12-11 Thread Denis Kozlov
I have rewritten SimpleIPC implementation for Windows. Summary of changes: 1. Using SetTimer + GetMessage method for handling PeekMessage. 2. Store all received incoming messages in a message queue (per IPC server instance). 3. Implemented message queue (PeekMessage receives messages, ReadMessage

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2015-12-08 Thread Luca Olivetti
El 08/12/15 a les 08:55, Ondrej Pokorny ha escrit: Nevertheless SimpleIPC uses files on Linux as well. FIFOs, not regular files. Bye -- Luca ___ fpc-devel maillist - fpc-devel@lists.freepascal.org

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2015-12-08 Thread Michael Schnell
On 12/06/2015 03:03 AM, Denis Kozlov wrote: The only way to make TSimpleIPCServer.PeekMessage respect DoReadMessage=False parameter is to store locally all sent data streams TThread does contain a queue for "TThread.Synchronize" and "TThread.Queue". It is decently managed for the main

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2015-12-07 Thread Ondrej Pokorny
On 07.12.2015 20:56, Michael Van Canneyt wrote: Interesting point! From this point-of-view I don't have to create the connection layer between SimpleIPC and AdvancedIPC as me suggested here: http://lists.freepascal.org/pipermail/fpc-devel/2015-September/035958.html It makes sense. Well,

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2015-12-07 Thread Denis Kozlov
On 6 December 2015 at 08:29, Ondrej Pokorny wrote: > If you don't persist in using SimpleIPC, there is also AdvancedIPC that uses > the same approach (temporary files) across all targets and so it behaves > consistently. I think SimpleIPC and AdvancedIPC complement each other.

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2015-12-07 Thread Ondrej Pokorny
On 07.12.2015 20:00, Michael Van Canneyt wrote: On Mon, 7 Dec 2015, Denis Kozlov wrote: On 6 December 2015 at 08:29, Ondrej Pokorny wrote: If you don't persist in using SimpleIPC, there is also AdvancedIPC that uses the same approach (temporary files) across all targets

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2015-12-07 Thread Michael Van Canneyt
On Mon, 7 Dec 2015, Ondrej Pokorny wrote: On 07.12.2015 20:00, Michael Van Canneyt wrote: On Mon, 7 Dec 2015, Denis Kozlov wrote: On 6 December 2015 at 08:29, Ondrej Pokorny wrote: If you don't persist in using SimpleIPC, there is also AdvancedIPC that uses the same

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2015-12-07 Thread Michael Van Canneyt
On Mon, 7 Dec 2015, Denis Kozlov wrote: On 6 December 2015 at 08:29, Ondrej Pokorny wrote: If you don't persist in using SimpleIPC, there is also AdvancedIPC that uses the same approach (temporary files) across all targets and so it behaves consistently. I think

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2015-12-06 Thread Ondrej Pokorny
On 06.12.2015 03:03, Denis Kozlov wrote: There are alternative IPC mechanisms available in Windows (Pipes, Sockets, DDE, etc), but that might be like opening another can of worms. I'm still confident that we can get a fully functioning IPC going using WM_COPYDATA, it just might get a bit more

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2015-12-06 Thread Michael Van Canneyt
On Sun, 6 Dec 2015, Denis Kozlov wrote: I got the Plan B working (SetTimer+GetMessage) for SimpleIPC. However, it is not possible at all to get TSimpleIPCServer.PeekMessage to NOT read the message, i.e. to respect DoReadMessage=False parameter. The only way to make

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2015-12-05 Thread Michael Van Canneyt
On Fri, 4 Dec 2015, Denis Kozlov wrote: There is another problem with SimpleIPC on Windows. This same problem was experienced in @Juha's post "SimpleIPC and TWinMsgServerComm.PeekMessage": http://lists.freepascal.org/pipermail/fpc-devel/2013-October/032871.html TWinMsgServerComm.PeekMessage

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2015-12-05 Thread Denis Kozlov
I got the Plan B working (SetTimer+GetMessage) for SimpleIPC. However, it is not possible at all to get TSimpleIPCServer.PeekMessage to NOT read the message, i.e. to respect DoReadMessage=False parameter. Every message queue accessing function in Windows (e.g. PeekMessage, GetMessage)

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2015-12-04 Thread Denis Kozlov
There is another problem with SimpleIPC on Windows. This same problem was experienced in @Juha's post "SimpleIPC and TWinMsgServerComm.PeekMessage": http://lists.freepascal.org/pipermail/fpc-devel/2013-October/032871.html TWinMsgServerComm.PeekMessage never waits for a Timeout because of this

Re: [fpc-devel] Inconsistent use of Timeout in SimpleIPC

2015-12-03 Thread Michael Van Canneyt
On Wed, 2 Dec 2015, Denis Kozlov wrote: Hello, Current use of Timeout parameter in TSimpleIPCServer.PeekMessage: * >0 -- number of milliseconds to wait. * 0 -- not documented and inconsistent! * Windows -- wait infinitely (forced via MsgWaitForMultipleObjects) * Unix -- return immediately

[fpc-devel] Inconsistent use of Timeout in SimpleIPC

2015-12-02 Thread Denis Kozlov
Hello, Current use of Timeout parameter in TSimpleIPCServer.PeekMessage: * >0 -- number of milliseconds to wait. * 0 -- not documented and inconsistent! * Windows -- wait infinitely (forced via MsgWaitForMultipleObjects) * Unix -- return immediately (implicit via fpSelect) * OS/2 -- return