OnRun() IF ISCLEAR(ComCom) THEN CREATE(ComCom); IF ISCLEAR(SBA) THEN CREATE(SBA); ComCom.AddBusAdapter(SBA, 0); IF ISCLEAR(OutMsg) THEN BEGIN OutMsg:= ComCom.CreateoutMessage('Sockets://locelhost:8888'); OutS:= OutMsg.GetStream(); OutS.WRITE('Hello World!'); //Test Kommuikation OutMsg.Send(0); END ELSE BEGIN OutS:= OutMsg.GetStream(); OutS.WRITE('Hello World!!!'); //Test Kommuikation OutMsg.Send(0); END; ComCom::MessageReceived(VAR InMessage : Automation "''.IDISPATCH") InMsg:= InMessage; InS:= InMsg.GetStream(); WHILE NOT (InS.EOS) DO BEGIN InS.READ(TXT); MESSAGE(TXT); END;
Comments
I’ve had the same problem. As far as I know, it’s not possible to use the event "messageReceived" on a client.
I’ve solved the problem with the onTimer property in a from. This onTimer event triggers a function in a single instant codeunit with checks if something’s is available on the winsock buffer. I’m not using the comcom adapter but I’m using the winsock.ocx. It’s not very elegant but It works.
Good luck
Henry
Thanks for your fast answer but you have bad news!!! The solution that you propose me, i have implement a year ago.
This solution was very inefficient!!! It is a performence-Killer!
An other alternative is develop a Server Socket with navision, but i have the same problems. I don't understand this!
Regards
Urknall
Yes, it’s true it is not the best performance solution. But the a Navision socket server sould be no problem.
As you have installed a Navision client there is a small but very usefull (hidden) OnlineHelp. You'll find it under c:\program files\shared files\navision\communication component\devguide.chm.
This OnlineHelp gives examples (sending and receiving data) for all kinds of adapters (socket, message queue and named pipe). I think there you'll find all you need.
Hope I could help.
I have build an Server Socket application, but i received only one message in my event trigger.
When i set the CommitMessage Command the Connection will be killed!
And how can i send my data to connected clients? How can i identify connected clients? thats all my problems
Kind Regards
Urknall
Here is a example for Data receiving and sending in one process. It’s is possible to identify connected clients by there IP address using The Source Property. This property reveals the IP address of the sender of the message.
The Navision Socket Bus adapter is a very strange component. :roll: For example it can have multiple connections, but I can only process one connection a time. And yes it kills the connection when the CommitMessage is send. There’s nothing you can do about it. Navision 4.0 will be more .NET based so perhaps there will be a better socket bus adapter in Navision 4.0.
Good luck,
Henry
Rgds
Benny
Benny Giebens
Navision 4.0 = no improvement.
You'll have to write your own external socket server component and send it into something Navision understands, like a message queue.
RIS Plus, LLC