Multiple INET sockets (mulple IP's too) connected to UNIX sockets
- by Andrew
HOST = same host all the time, accepts multiple connection. I have a dedicated server and I will buy extra IP's.
Socket 1 connects to HOST:PORT, from IP-1
Socket 2 connects to HOST:PORT, from IP-1
Socket 3 connects to HOST:PORT, from IP-1
Socket 4 connects to HOST:PORT, from IP-2
Socket 5 connects to HOST:PORT, from IP-2
Socket 6 connects to HOST:PORT, from IP-2
After creating all sockets I want to access them easy as UNIX sockets from PHP.
/sys/socket1
/sys/socket2
/sys/socket3
/sys/socket4
/sys/socket5
/sys/socket6
I want the sockets to work in background (like daemon) and I want to be able to connect from PHP to any of this sockets and RECV/SEND whatever I want.
I saw "socat" and I think that's the solution for me, please tell me how to use socat, or how to do it other way.
Thankyou!