Tag:Echo server

  • PHP uses spool to write a simple echo server example

    Time:2021-4-22

    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(‘0.0.0.0’, 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

    Time:2020-11-17

    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(“127.0.0.1:7001”, exitChan) //Channel blocked, waiting to receive […]