A PHP-based TCP service method and a server

Yin Chuanwen,Wu Feng,Guo Wei
2019-01-01
Abstract:The invention discloses a PHP-based TCP service method and a server mode, and the method comprises the steps: starting a socket service through a PHP service application program, and monitoring a service port; Receiving a data packet sent by a client through the service port; Processing the data packet according to a communication protocol corresponding to the service port to obtain correspondingdata with a programmable data structure; And calling a function corresponding to the communication protocol to process the data to obtain a corresponding execution result. The purpose of establishinga PHP-based TCP service method is achieved, so that the TCP service obtained through development of the invention can easily cope with a high-concurrency service scene, and meanwhile, the high availability of the service is ensured; Clients of any language only need to realize corresponding communication protocols, and the cluster service can be called; Meanwhile, the cluster service realized through the method and the device only provides the network service in the local area network, so that the performance and the safety can be guaranteed.
What problem does this paper attempt to address?