In my following socket server, I am trying to listen to a connection through port 12345 in my web browser. http://127.0.0.1:12345/
I assumed that the following would detect that something was trying to connect to the port through the browser, using socket_create_listen(). I don't know if I am doing something wrong or just not understanding what socket_create_listen() is doing.
Does anyone know why when going to the address, my socket server isn't detecting the connection?
Note: The client is supposed to be the web browser, not another php file.
Here is my server class:
Code: [Select]<?php
set_time_limit(0);
class Pherver{
private $setup;
public $server;
public $connections;
function __construct(){
$this->setup = parse_ini_file("config.ini", TRUE);
$this->server = socket_create_listen($setup['server']['port'], $etup['server']['connections']);
socket_listen($this->server);
}
function start(){
while($client = socket_accept($this->server)){
socket_write($client, "hello");
print "here";
}
}
}
?>
Here is how I start the server:
Code: [Select]<?php
include 'Pherver.php';
$server = new Pherver();
$server->start();
?>
Thank you
Text Not Displaying Correctly With PHP:GD
I recently moved servers and since then I have noticed that one line of text is showing weirdly.I have attached an example image that was generated. In the word 'Managing' the letters M & N
search function
HI guys,if anyone could point us in the right direction of how to do this, or provide some test code for a similar problem would be great!Basically, I have user profiles on my site, and I have a
line breaks in between fetched file names
Hi,I have this code:Code: <?php if($dir = opendir('files')){ while (($file = readdir($dir) )!== false){ if ($file !='.' && $file !='..'){ echo
Quick variable question
hey guys/gals, im trying to write a php script and it works fine as i have it, but i need to set it to where it pulls the var from mysql table that it is displayed differeantly. i.e. if $var==abcdefg
Any Good MMORPGs you've played?
I'm about to have ALOT of free time on my hands (finished highschool) and I need something to fill the void. I tried Atlantica Online a while ago and really liked it (Gonna download it again) and I
How to use Ajax to verify data on a DB ?
Hello everyone, well i want to know how to check a value if it exists or not on a Data base and capturing this without making postback (no click on a button or other control) ofcourse by using Ajax,
Packet Design
Hi All,Im new about network programming and I want to design a protocol but I have some questions about packet desing. For example I wanna do a sturct to send informations like that ;struct info {
Agency Business Process
Hi,
[Need Help] php timing issues
I don't know what is going wrong. I need some help with being able to set an image at 9:00am Colorado time if my server is in California and it would be 8:00am. I tried to echo the image below, but
Stumped by Third Day of Month problem
I am trying to build an algorithm that will essentially do this: Code: [Select]$this_month = October$third_sunday = CalculateThirdSunday(October)if ( ( TodaysDate before $third_sunday ) | ( TodaysDate