HttpServer
extends AbstractServer
in package
implements
ServerInterface
Http swoole server
Table of Contents
Interfaces
- ServerInterface
- Server interface
Constants
- DEFAULT_HOST = 'locahost'
- DEFAULT_PORT = '8080'
- STATUS_RUNNING = 'run'
- STATUS_STOP = 'stop'
Properties
- $host : string
- Server host
- $options : array<string|int, mixed>
- Server options
- $port : string
- Server port
- $server : Server|null
- Http server swoole instance
Methods
- __construct() : mixed
- Constructor
- boot() : void
- Boot server
- consoleMsg() : void
- Show console messge
- getOption() : mixed
- Get option
- hostToString() : string
- Get server host with port
- run() : void
- Run server
- stop() : void
- Stop server
Constants
DEFAULT_HOST
public
mixed
DEFAULT_HOST
= 'locahost'
DEFAULT_PORT
public
mixed
DEFAULT_PORT
= '8080'
STATUS_RUNNING
public
mixed
STATUS_RUNNING
= 'run'
STATUS_STOP
public
mixed
STATUS_STOP
= 'stop'
Properties
$host
Server host
protected
string
$host
$options
Server options
protected
array<string|int, mixed>
$options
$port
Server port
protected
string
$port
$server
Http server swoole instance
private
Server|null
$server
Methods
__construct()
Constructor
public
__construct([string $host = null ][, string $port = null ][, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $host : string = null
- $port : string = null
- $options : array<string|int, mixed> = []
boot()
Boot server
public
boot() : void
consoleMsg()
Show console messge
public
consoleMsg(string $message) : void
Parameters
- $message : string
getOption()
Get option
public
getOption(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
hostToString()
Get server host with port
public
hostToString() : string
Return values
stringrun()
Run server
public
run() : void
stop()
Stop server
public
stop() : void