Jump to content

PHP Sockets: Keeping sockets open..?


XenoPhyre

Recommended Posts

In a PHP script that uses PHP sockets, if you call socket_create yet forget to (or intentionally do not) call socket_close(), does the socket automatically close itself at the end of the scripts' execution or does it remain open even after the script finishes and dies?

 

I actually want to intentionally keep a socket open; I'm writing a frontend server script that responds to AJAX calls, it uses a certain port to query a backend server application bound to another port. Since I most likely will be receiving multiple calls from multiple users, I wonder if and how  I could have multiple instances of the frontend script using the same port, and if/how I could keep a port opened for these multiple instances. Obviously I can't have each instance calling socket_create on the same port.

Link to comment
https://forums.phpfreaks.com/topic/119825-php-sockets-keeping-sockets-open/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.