equal
deleted
inserted
replaced
102 |
102 |
103 function __construct($address = '127.0.0.1', $port = 8080) |
103 function __construct($address = '127.0.0.1', $port = 8080) |
104 { |
104 { |
105 @set_time_limit(0); |
105 @set_time_limit(0); |
106 @ini_set('memory_limit', '256M'); |
106 @ini_set('memory_limit', '256M'); |
|
107 |
|
108 // do we have socket functions? |
|
109 if ( !function_exists('socket_create') ) |
|
110 { |
|
111 burnout('System does not support socket functions. Please rebuild your PHP or install an appropriate extension.'); |
|
112 } |
107 |
113 |
108 $this->sock = socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp')); |
114 $this->sock = socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp')); |
109 if ( !$this->sock ) |
115 if ( !$this->sock ) |
110 throw new Exception('Could not create socket'); |
116 throw new Exception('Could not create socket'); |
111 $result = socket_bind($this->sock, $address, $port); |
117 $result = socket_bind($this->sock, $address, $port); |