PDA

View Full Version : IpcPublisherSocket ports



eldera
12-11-2015, 01:37 PM
1) Is it possible to check if x port is already used by IpcPublisherSocket without crashing script?



14:30 XenoScript Error:
Script: 111/11.lua
Error: Address in use
This is an error with user-input and should not be reported as a bug with
XenoBot.


2) Is there an IPC pattern that allows to have multiple publishers and only one subscriber? I want to send data from multiple clients to "server" which will do something with data and will never send anything back to clients.

I think it's possible with REP/REQ but I don't want server to send anything back to clients because when server crashes or turns off all clients will wait for response but they will never get it because server is off.

Syntax
12-11-2015, 06:35 PM
1) Is it possible to check if x port is already used by IpcPublisherSocket without crashing script?



14:30 XenoScript Error:
Script: 111/11.lua
Error: Address in use
This is an error with user-input and should not be reported as a bug with
XenoBot.


2) Is there an IPC pattern that allows to have multiple publishers and only one subscriber? I want to send data from multiple clients to "server" which will do something with data and will never send anything back to clients.

I think it's possible with REP/REQ but I don't want server to send anything back to clients because when server crashes or turns off all clients will wait for response but they will never get it because server is off.

The server can run a publisher where client subscribing gets an available port in the message.
Once the client gets the port it sets up a subscriber that the server is already listening to.
The client sends a message saying "hey I used this port" and the server increments the port for the next client connecting to use.
Now you have a bi-directional communication using multiple pub/subs.

I can post an example soonish if you need it.

eldera
12-11-2015, 09:26 PM
The server can run a publisher where client subscribing gets an available port in the message.
Once the client gets the port it sets up a subscriber that the server is already listening to.
The client sends a message saying "hey I used this port" and the server increments the port for the next client connecting to use.
Now you have a bi-directional communication using multiple pub/subs.

I can post an example soonish if you need it.

Nah you don't need to. Thanks for help!