title: Reusable socket
body: <p>I tryed to create a socket in php and reuse it from other process.
  I know this can be done with a daemon script but I want to do this without.</p>
  
  <p>I created a socket and binded it to a specific port.</p>
  
  <pre><code>$sock = socket_create (AF_INET, SOCK_STREAM, SOL_TCP);  
  socket_set_option ($sock, SOL_SOCKET, SO_REUSEADDR, 1); 
  socket_bind ($sock, 'xx.xx.xx.xx', 10000);
  socket_connect ($sock, $host, $port);
  </code></pre>
  
  <p>And from another php file I did the same thing. But the packets that I send from the 2 file are not "validated" by host. I sniffed all ports and I see that it uses same local and destination port. I don't understand where is the problem.</p>
  
  <p>Can you help me with this?
  It's ok in any other programming language, or any other solution for this.</p>
  
  <p>Andrew</p>