Multiple INET sockets (mulple IP's too) connected to UNIX sockets

Posted by Andrew on Stack Overflow See other posts from Stack Overflow or by Andrew
Published on 2010-03-17T00:31:03Z Indexed on 2010/03/17 0:51 UTC
Read the original article Hit count: 779

Filed under:
|
|

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!

© Stack Overflow or respective owner

Multiple INET sockets (mulple IP's too) connected to UNIX sockets

Posted by Andrew on Server Fault See other posts from Server Fault or by Andrew
Published on 2010-03-17T00:35:05Z Indexed on 2010/03/17 0:41 UTC
Read the original article Hit count: 779

Filed under:
|
|

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!

© Server Fault or respective owner

Related posts about socket

Related posts about php