Page 1 of 1

Fsockopen

Posted: Sat Jul 03, 2010 3:31 am
by kirank
Hi,

I wanna open one php socket connection to a remote server for 24 hours, ie the connection wont be closed.
I need to run more than 10 sockets like this. I used pfscockopen. The program runs from the CLI.
But the connection is working in different manner, ie closing after sometime.

My script works in i an infinite loop with delay in each intervals and it exeuctes for along time , but not the connection.


How can i make the connection alive. The remote server is an SMPP gateway. SO i need to be alive with the connection. Any idea why the connection closing !

Why PHP can't establish a network connection ie not closing.

Re: Fsockopen

Posted: Sat Jul 03, 2010 3:58 am
by requinix
I can't think of any good reason for keeping a socket open for a solid 24 hours. Are you constantly using it?

Re: Fsockopen

Posted: Sat Jul 03, 2010 7:12 am
by kirank
Yes, i want to be connected for 24 hours.

The server sends information through the socket and also i want to send to the server. We cant predict when the server responses with messages. The system is an SMS server. SO i want to be connected alive for 24 hours .