I need to make a script that is server and client at the same time.
This needs to alternate from listening to trying to connect.
Is there a way to temporarily block any client from connecting while it proceeds to client mode and attempts to connect?
As far as I have noticed there is only a permanent way to stop this that would involve starting to listen again and I am trying to avoid that.
The idea is that this will run on multiple servers and it will have to connect to itself.
Each time a connection is made each party removes the other from list of (clients/destinations) once they exchange what they need to exchange.
So I need a way to block the listener while it attempts a connection cause on rare occasions two attempt connection to each other at the exact same time and bought hang waiting to be picked up but that does not happen.
You could either do:
The above three options are from the systemcall/OS level. I don’t know how PHP implements (or wraps) them.