S
S
SEOD2019-02-18 11:48:43
PHP
SEOD, 2019-02-18 11:48:43

Are udp servers written in PHP?

The idea was born to write a UDP server in PHP. How bad is this idea? :)
Just another option to quickly roll it into Node.js. How much more promising will node.js be than PHP in this direction or vice versa?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Aksentiev, 2019-02-18
@Sanasol

With a maximum message load of 15 per minute (~500 bytes per minute).

what for you such a realtime server, let it hammer in the old fashioned way with interval requests for a puff script then.
And in general, you can do it on a php server, it’s just usually not worth it and there’s more crap than in another language more suitable like nodejs. Because you need asynchronism, and that's all for full-fledged servers.

O
Oleg, 2019-02-18
@402d

https://github.com/yswery/PHP-DNS-SERVER/blob/mast...
Here is an example of a dns server in php that
is assembled into a phar file and starts as a service on the server
Or do you have to ensure that the UDP packet is transmitted over the network?
php.net/manual/ru/function.stream-socket-recvfrom.php
There is nothing good on the git
https://github.com/search?l=PHP&q=stream_socket_re...
so you will be the first
here is the simplest
https: //stackoverflow.com/questions/17631711/how-t...
but it needs to be rewritten to run from cli and remove execution time limits

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question