Jump to content

reapfyre

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

reapfyre's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yeah I have used MySQL to do the transfer, which also works, but aren't as fast as a straight pass of a variable...even saving to a file will have I/O operations which are slower aswell, especially when it could be doing hundreds of operations a second.. What would be great is if PHP had developed the ability for seperate PHP threads to communicate to each other, without using sockets and databases and flat files. At the moment there only seems to be Sessions, which do not update asynchronously through the threads.
  2. Im already using AJAX and Reverse AJAX... I didn't want to constantly call a PHP page every second as all the headers, etc get sent everytime... Through a script that never ends I have a permenant connection to the client, so I can send the client any update whenever the server decides to...but the script doesn't pick up the session change without destroying and then reloading the session (thus retrieving the stored variables). Unless I start using shared memory functions in the Unix kernal.... but memory management across hundreds of users may have scaleability issues aswell. Any other ways anyone can think of?
  3. Hi Guys, I'm trying to do something a little tricky and trying to find the quickest code to do it. I have 2 PHP pages con-currently running on the one Web Page... Both these pages share the same sessionID as they are from the same Browser page. What I basically want is to beable to change the value of a session variable in one page, and beable to pick up that change in the other page. I have used MySQL / Flat files to pass information between these two pages and have even thought of using Sockets, but scaleability is an issue with that and MySQL is slower than a straight pass to a Session variable. Basically one PHP Script is constantly running in a While loop and never ends, it checks the session of any updated variables which in my code, is changed from the other page. I do have this working right now, but its a bit messy. In order for the never-ending script to see any changes made to the Session, you basically have to Refresh the Session to receive the changes. So basically my code now is: while(true) { session_start(); if(isset($_SESSION['MYVAR'])) { //Do Something break; } session_destroy(); sleep(1); } This works fine but Im wondering whether there is a better way? Session_Start will only allow you to call it once, unless its destroyed first, so I really need a session_refresh(); if it existed...anyone have any ideas? Thanks heaps. Mark
×
×
  • 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.