P
P
pavelkolodin2017-12-12 22:11:04
PHP
pavelkolodin, 2017-12-12 22:11:04

By what protocols can PHP connect somewhere in principle?

By what protocols, in principle, can PHP connect somewhere without writing its own extensions? Well, for example HTTP, Memcache (vk.com uses it as PHP <-> C daemons transport), MySQL.
What else?
Purpose: to make the most simple C++ / Python server using this protocol, so that PHP can throw a kilobyte of arbitrary data, or at least JSON, onto this server as cheaply as possible. Why does vk.com have transport with daemons specifically on MC, and not on HTTP - apparently the overhead is less - HTTP has a ton of text headers (I don’t know how the MC protocol works). Why didn't they do something of their own - apparently Mc is quite simple.
And what else is simple and angry out of the box?
Interested in something high-level HTTP / MC, implemented to the compiled code (php core and its boxed extensions), called in a couple of lines of code like

$resp = request("1.2.3.4", 5515, "{ 'r' : 'request', 'param' : 42 }");

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
doublench21, 2017-12-12
@doublench21


<?php
$xportlist = stream_get_transports();
print_r($xportlist);
?>
Array (
[0] => tcp
[1] => udp
[2] => unix
[3] => udg
)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question