View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0036454||FPC||FCL||public||2019-12-17 21:33||2020-01-02 00:05|
|Reporter||Julian Meyn||Assigned To||Marco van de Voort|
|Summary||0036454: 0029717: TSimpleIPC Communication not working anymore since Lazarus 1.6|
|Description||As in 0029717 described, I think the bug is not fixed.|
Sorry for opening a new bug, did not find to reopen the old one.
simpleIPC is was working last with lazarus 1.44 and is not working since 1.6 until now, 2.06.
The IPC Client does not find the IPC Server. See the example in uploaded file.
|Steps To Reproduce||Try a simple communication between SimpleIPC Client and Server|
|Additional Information||The Feature was working in Lazarus 1.4.4 FPC 2.6.4|
|Tags||No tags attached.|
|Fixed in Revision|
TsimpleIPC Test.zip (255,670 bytes)
What version of Lazarus and fpc are you using?
You need at least fpc 3.0.2 (comes with Lazarus 1.6.4) of newer.
||I'm using Lazarus 2.0.6 with FPC 3.0.4|
I think the bug is located in the server,
I compiled the client with lazarus 2.06 and server with 1.44, communication still working.
When using 2.06 server and 1.44 Client or 2.06 Client, both both not working.
||TSimpleIPC belongs to fpc, so moving the issue there.|
||FPC 3.0.x is EOL please retest with a development version|
The demo project does not work either with fpc 3.3.1 r43417.
The server gets an OnMessageQueued event, so a message is pushed.
If I set MaxAction := ipcmoaError (on the server) I get:
If I add an OnMessageQueued event to the server and in the event call ReadMessage then the message shows up in the OnMessage event:
procedure TForm1.SimpleIPCServer1MessageQueued(Sender: TObject);
cnt: integer = 0;
Memo1.Lines.Add('SimpleIPCServer1MessageQueued, count: '+IntToStr(cnt));
if SimpleIPCServer1.ReadMessage then
Now pressing Button1 on the client gives me:
SimpleIPCServer1MessageQueued, count: 1
SimpleIPCServer1Message received: "message to server"
SimpleIPCServer1MessageQueued, count: 2
SimpleIPCServer1Message received: "message to server"
DoOnMessage only gets called in ReadMessage. ReadMessage is only called (automatically) in PeekMessage and PeekMesage is nowhere called inside TSimpleIPCServer.
So one has to call ReadMessage manually.
I don't know if this is how you are supposed to make it work though, I never used this component before.
When I look at the sources from fpc 2.6.4 (which TS said worked fine), then I also only see OnMessage being called from within ReadMessage, and ReadMessage is nowhere called except in PeekMessage (which is only called by the programmer). So basically the same as in trunk.
||Note that, even with the solution above, it still will give an OnMessageError if the servers MacQueue is set to zero (which is it's default value).|
||I can confirm the the sample project (TsimpleIPC Test.zip) works as described by Julian Meyn with Lazarus 1.4.4/fpc 2.0.6 win32 on Win10-64.|
In fpc 2.06 theServer's MsgWndProc function calls ReadMessage of the server directly.
In fpc trunk the MsgWndProc function calls the server's TryReadMsgData (on Windows: TWinMsgServerComm.TryReadMsgData) -> TWinMsgServerComm.ReadMsgData -> TIPCServerComm.PushMessage -> TSimpleIPCServer.PushMessage -> TSimpleIPCServer.DoOnMessageQueued
So, no explicit call to TSimpleIPCServer.ReadMessage is made.
AFAICS this change in behaviour is not documented in any of the fpc > 2.06 release notes on the wiki.
"MaxQueue is the maximum number of messages in the queue. When this amount is zero, the amount of messages is unlimited."
This does not seem to be true.
If MaxAction = ipcmoaDiscardOld or ipcmoaError then an OnMessageError is fired.
If MaxAction = ipcmoaDiscardNew then the message is pushed, but ReadMessage returns False
the debug message server contained in [lazarus dir] \tools\debugserver also uses simpleipc BUT IT WORKS
when compiling it with lazarus 2.0.6!
It has the server ID 'fpcdebugserver'.
It works a little bit different to the sample project here because it uses streams for messages,
But maybe still interesting to find out information about the problem.
|2019-12-17 21:33||Julian Meyn||New Issue|
|2019-12-17 21:33||Julian Meyn||File Added: TsimpleIPC Test.zip|
|2019-12-17 22:28||Bart Broersma||Note Added: 0119899|
|2019-12-17 22:28||Bart Broersma||Status||new => feedback|
|2019-12-17 22:28||Bart Broersma||LazTarget||=> -|
|2019-12-17 22:29||Bart Broersma||Relationship added||related to 0029717|
|2019-12-18 05:30||Julian Meyn||Note Added: 0119903|
|2019-12-18 05:30||Julian Meyn||Status||feedback => new|
|2019-12-18 05:40||Julian Meyn||Note Added: 0119904|
|2019-12-18 14:23||Bart Broersma||Note Added: 0119911|
|2019-12-18 14:24||Bart Broersma||Project||Packages => FPC|
|2019-12-18 14:30||Marco van de Voort||Assigned To||=> Marco van de Voort|
|2019-12-18 14:30||Marco van de Voort||Status||new => feedback|
|2019-12-18 14:30||Marco van de Voort||FPCTarget||=> -|
|2019-12-18 14:30||Marco van de Voort||Note Added: 0119912|
|2019-12-18 22:21||Bart Broersma||Note Added: 0119932|
|2019-12-18 22:24||Bart Broersma||Note Edited: 0119932||View Revisions|
|2019-12-18 22:31||Bart Broersma||Note Edited: 0119932||View Revisions|
|2019-12-19 23:15||Bart Broersma||Note Added: 0119966|
|2019-12-19 23:28||Bart Broersma||Note Edited: 0119966||View Revisions|
|2019-12-20 22:26||Bart Broersma||Note Added: 0119983|
|2019-12-21 12:42||Bart Broersma||Note Added: 0119989|
|2019-12-21 13:04||Bart Broersma||Note Added: 0119990|
|2019-12-21 13:06||Bart Broersma||Note Edited: 0119990||View Revisions|
|2019-12-21 13:40||Bart Broersma||Note Added: 0119992|
|2020-01-02 00:05||Julian Meyn||Note Added: 0120178|
|2020-01-02 00:05||Julian Meyn||Status||feedback => assigned|