Tag:Echo server

  • PHP uses spool to write a simple echo server example


    This article describes a simple echo server written by PHP using spool. The details are as follows: server.php The code is as follows: <?php class EchoServer { protected $serv = null; public function __construct() { $this->serv = new swoole_server(‘’, 8888); //Configuration parameters $this->serv->set(array( ‘worker_num’ => 4, ‘daemonize’ => 0, )); //Register callback function $this->serv->on(‘start’, array($this, […]

  • Implementation of Telnet echo server in go language


    This paper introduces the go language telnet echo server and shares it with you. The details are as follows: package main import ( “fmt” “net” “bufio” “strings” “os” ) func main() { //Create a channel for program end code exitChan := make(chan int) //Run the server concurrently go server(“”, exitChan) //Channel blocked, waiting to receive […]