mineisredonly Posted February 12, 2007 Share Posted February 12, 2007 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 More sharing options...
thepip3r Posted February 12, 2007 Share Posted February 12, 2007 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. Link to comment https://forums.phpfreaks.com/topic/38130-persisted-tcp-connection/#findComment-182546 Share on other sites More sharing options...
mineisredonly Posted February 12, 2007 Author Share Posted February 12, 2007 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? Link to comment https://forums.phpfreaks.com/topic/38130-persisted-tcp-connection/#findComment-182558 Share on other sites More sharing options...
btherl Posted February 12, 2007 Share Posted February 12, 2007 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. Link to comment https://forums.phpfreaks.com/topic/38130-persisted-tcp-connection/#findComment-182569 Share on other sites More sharing options...
heckenschutze Posted February 12, 2007 Share Posted February 12, 2007 Why does this connection need to be maintained...? Just reconnect every request... Link to comment https://forums.phpfreaks.com/topic/38130-persisted-tcp-connection/#findComment-182571 Share on other sites More sharing options...
mineisredonly Posted February 12, 2007 Author Share Posted February 12, 2007 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? Link to comment https://forums.phpfreaks.com/topic/38130-persisted-tcp-connection/#findComment-182574 Share on other sites More sharing options...
mineisredonly Posted February 12, 2007 Author Share Posted February 12, 2007 Why does this connection need to be maintained...? Just reconnect every request... If i do like this server will consider each request as different user. This is not what i want. Link to comment https://forums.phpfreaks.com/topic/38130-persisted-tcp-connection/#findComment-182575 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.