21 namespace Erebot\Identd;
30 class Server implements \Erebot\Interfaces\ReceivingConnection
65 $connector =
'0.0.0.0:113',
70 $this->socket = stream_socket_server(
'tcp://' . $connector, $errno, $errstr);
73 "Could not create identd server (".$errstr.
")"
84 public function connect()
86 $this->bot->addConnection($this);
89 public function disconnect($quitMessage = null)
91 $this->bot->removeConnection($this);
92 if ($this->socket !== null) {
93 stream_socket_shutdown($this->socket, STREAM_SHUT_RDWR);
98 public function isConnected()
103 public function getSocket()
108 public function emptyReadQueue()
113 public function read()
115 $socket = stream_socket_accept($this->socket);
119 $worker =
new $this->workerCls($this->bot,
$socket);
128 public function getBot()
133 public function getConfig($chan)
138 public function getIO()
$bot
A bot object implementing the Erebot::Interfaces::Core interface.
Provides core functionalities for Erebot.
$workerCls
Class to use to process IdentD requests.
$socket
The underlying socket, represented as a stream.
process()
Processes commands queued in the input buffer.
A server compatible with the Identification Protocol (RFC 1413).
__construct(\Erebot\Interfaces\Core $bot, $connector= '0.0.0.0:113', $workerCls= '\\Erebot\\Identd\\Worker')