IF ISCLEAR(CC2) THEN CREATE(CC2); IF ISCLEAR(SBA) THEN CREATE(SBA); CC2.AddBusAdapter(SBA, 0); SBA.OpenSocket(8079, ''); CC2::MessageReceived(VAR InMessage : Automation "''.IDISPATCH") InMsg:= InMessage; InS:= InMsg.GetStream(); WHILE NOT (InS.EOS) DO BEGIN InS.READ(Txt); MESSAGE(Txt); END; InMsg.CommitMessage();Client code
IF ISCLEAR(CC2) THEN CREATE(CC2); IF ISCLEAR(SBA) THEN CREATE(SBA); CC2.AddBusAdapter(SBA, 0); OutMsg:= CC2.CreateoutMessage('Sockets://localhost:8079'); OutS:= OutMsg.GetStream(); OutS.WRITE('First Text'); OutS.WRITE('Second Text'); OutS.WRITE('Third Text'); OutMsg.Send(0);
Comments
The server codeunit must have a property SingleInstance = Yes
This work http://mibuso.com/dlinfo.asp?FileID=805
tnx