Conversation
Won't be able to look into this in detail for a while, but:
|
thanks for your input @fredemmott 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, .php files only, and why are there hhi files?
@fredemmott |
to be used later with new implementation of dns_get_record
currenlty i'm having problems with this would work : use namespace HH\Lib\Experimental\IO;
use namespace HH\Lib\Experimental\Network;
require __DIR__ . '/../vendor/autoload.hack';
<<__EntryPoint>>
async function tcp_client(): Awaitable<void> {
Facebook\AutoloadMap\initialize();
$stdout = IO\server_output();
$client = await Network\TcpSocket::connect(
Network\host('www.google.com'),
80
);
try {
$request = '';
$request .= 'GET / HTTP/1.1'."\r\n";
$request .= 'Host: www.google.com'."\r\n\r\n";
await $client->writeAsync($request);
$response = await $client->readAsync(8192);
await $stdout->writeAsync($response . "\n");
} catch (Exception $e) {
await $client->closeAsync();
throw $e;
}
await $client->closeAsync();
await $stdout->closeAsync();
} but if we change |
currently, this : use namespace HH\Lib\Experimental\IO;
use namespace HH\Lib\Experimental\Network;
require __DIR__ . '/../vendor/autoload.hack';
<<__EntryPoint>>
async function tcp_client(): Awaitable<void> {
Facebook\AutoloadMap\initialize();
$client = await Network\TcpSocket::connect(
Network\host('www.google.com'),
80
);
try {
$request = '';
$request .= 'GET / HTTP/1.1'."\r\n";
$request .= 'Connection: close'."\r\n";
$request .= 'Host: www.google.com'."\r\n\r\n";
await $client->writeAsync($request);
await $client->flushAsync();
$response = await $client->readAsync();
echo $response;
} catch (Exception $e) {
await $client->closeAsync();
throw $e;
}
await $client->closeAsync();
} would work as expected, but if we change connection to
hhvm issue to add these : facebook/hhvm#8451 |
Thanks; this is going to influence the implementation, but not going to be merging as-is: it's likely to be many smaller changes building up to a similar end state |
todo :
HH\Lib\Network\NativeSocketHandle
HH\Lib\Network\TcpServer
HH\Lib\Network\TcpSocket
HH\Lib\Network\UdpSocket