With above configuration, I’m able to create several ConsoleApps by running shells.
In Connected event(MainIPCSocketClass), I can also get ACK message from slave consoleapps.
However, when I try to send a message to those slaves, DataAvailable event of slave consoleapps(CollectorIPCSocket, Super:IPCSocket) never fire.
I’m using below code in Main app.
Are you running an event loop in the console app? Desktop apps provide an event loop for you, console apps do not. You need to call app.DoEvents in your console app (in a loop) to activate events.
Yes, I do. When I pass ‘START’ argument through shell, this slave sends the ‘IAMREADY’ message to Main well.
However, when Main tries to send a message to slave through IPCSocket, DataAvailable event of the slave doesn’t fire.
That’s the problem.
While not bFinished
App.DoEvents
If StopOrStartBoolean Then 'START
theIPCSocket = New CollectorIPCSocket
If repInstanceCountPassed = "0" Then
theIPCSocket.Path = SpecialFolder.Temporary.Child("com.example.ipcsocketexample").NativePath + str(0)
ElseIf repInstanceCountPassed = "1" Then
theIPCSocket.Path = SpecialFolder.Temporary.Child("com.example.ipcsocketexample").NativePath + str(1)
Else
logging("Unknown repInstanceCountPassed" )
End If
theIPCSocket.Connect
theIPCSocket.Write EndOfLine + "IAMREADY from StreamGroup : " + repStreamGPassed + " InstanceCount : " + repInstanceCountPassed + EndOfLine
Else 'STOP/False
exit While
End If
Wend
Quit(exitReason)