开发者

How to open PHP socket onto some URL? (like www.ex.com:8080/mySock/)

开发者 https://www.devze.com 2023-01-02 17:41 出处:网络
How to open PHP socket onto some URL? (like www.ex.com:开发者_高级运维8080/mySock/) I want to send user to a user Chart Room 1if ho goes to www.ex.com:8080/mySock/Chart1 and www.ex.com:8080/mySock/Ch

How to open PHP socket onto some URL? (like www.ex.com:开发者_高级运维8080/mySock/)

I want to send user to a user Chart Room 1 if ho goes to www.ex.com:8080/mySock/Chart1 and www.ex.com:8080/mySock/Chart2 to some other chart room if he goes into another (live php multy useres chart on sockets (Flash backend))


You can use:

$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_connect($socket, gethostbyname("www.ex.com"), 8080);

but are you sure you actually want a direct socket? If you clarify what you're actually doing, odds are PHP has some better way to accomplish it

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号