Fsockopen

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kirank
Forum Newbie
Posts: 23
Joined: Thu Dec 03, 2009 2:19 am

Fsockopen

Post 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.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Fsockopen

Post 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?
kirank
Forum Newbie
Posts: 23
Joined: Thu Dec 03, 2009 2:19 am

Re: Fsockopen

Post 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 .
Post Reply