Question about http server and socket server

dear All,

currently I have a swi-prolog web-server running on port 8443 and in another swi-prolog instance there is de chat socket server running on several ports . when something changes in the web server , i want this to be broadcasted on the connected chat sockets, to let the connected browsers know they have to update part of their pages. my question is to what would be a good way to realise / implement this. Would it be advisable to run the chat server-code inside the http web-server, or can I let these 2 swi-prolog instances communicate to eachother through the pipe system? thankyou in advance

There are many ways out. By far the simplest is probably to run the whole lot in one process. There many be good reasons not to. Next best is I think to use a message brokering system. The development versions have a pretty neat library to talk to Redis which provides a pub/sub style communication mechanism.

You can of course also setup your own connections between the Prolog processes. Pipes are a bit unpractical to setup as you cannot independently start/stop the processes and thus the single process solutions is probably better. Sockets are a better choice. It isn’t a big deal. In most cases I’d go for an off the shelf brokering system though.

Jan thankyou for the information.