Jump to content

Persisted TCP Connection


mineisredonly

Recommended Posts

is possible to persist the TCP Connection.?

 

I want to have TCP Connection for the first request of each user.

But on second request i need to send the request on same TCP Connection.

For this i need to persist the TCP Connection.

 

Is there any way to have static memory?

Link to comment
https://forums.phpfreaks.com/topic/38130-persisted-tcp-connection/
Share on other sites

are you talking about socket type connections or actually formulating packets and stuff?  If the case is the latter, you're looking at the wrong language mang.  creating your own packets and memory allocation is done using a language like C, C++ etc.  I don't think the PHP engine allows you to manipulate objects at the level it appears you're looking for.

are you talking about socket type connections or actually formulating packets and stuff? If the case is the latter, you're looking at the wrong language mang. creating your own packets and memory allocation is done using a language like C, C++ etc. I don't think the PHP engine allows you to manipulate objects at the level it appears you're looking for.

Basically i am writing the layer between HTTP Client and Server. with server i need TCP connection for each user.

In PHP i can create the sockets to the Server, i would like to write the data on socket based on the request from the HTTP Client(New TCP connection for the first request). But for each subsequent request i will use the same TCP connection corresponding to that user.

As PHP will finish its execution, reference to that TCP connection will be lost which i need to maintain.

 

in this regard how can achieve this persistant of TCP Connection?

 

Are you running php under a webserver, or standalone?

 

Running under a web server is not really suited to keeping persistent connections.  It may be possible, but it's not what the web server expects.

 

ya PHP is running under Apache Web server.

is there any way out without Web server?

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.