Skip to content

Commit 57bfe77

Browse files
committed
Prepare merging by updating namespace to Socket
This causes some tests to fail due to the StreamEncryption being present in this package and the original Socket component. This will be fixed in the follow-up commit.
1 parent 8ad621e commit 57bfe77

27 files changed

+69
-69
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SocketClient Component
1+
# Socket Component
22

33
[![Build Status](https://secure.travis-ci.org/reactphp/socket-client.png?branch=master)](http://travis-ci.org/reactphp/socket-client) [![Code Climate](https://codeclimate.com/github/reactphp/socket-client/badges/gpa.svg)](https://codeclimate.com/github/reactphp/socket-client)
44

@@ -405,12 +405,12 @@ $connector->connect('google.com:80')->then(function (ConnectionInterface $connec
405405

406406
### TcpConnector
407407

408-
The `React\SocketClient\TcpConnector` class implements the
408+
The `React\Socket\TcpConnector` class implements the
409409
[`ConnectorInterface`](#connectorinterface) and allows you to create plaintext
410410
TCP/IP connections to any IP-port-combination:
411411

412412
```php
413-
$tcpConnector = new React\SocketClient\TcpConnector($loop);
413+
$tcpConnector = new React\Socket\TcpConnector($loop);
414414

415415
$tcpConnector->connect('127.0.0.1:80')->then(function (ConnectionInterface $connection) {
416416
$connection->write('...');
@@ -439,7 +439,7 @@ You can optionally pass additional
439439
to the constructor like this:
440440

441441
```php
442-
$tcpConnector = new React\SocketClient\TcpConnector($loop, array(
442+
$tcpConnector = new React\Socket\TcpConnector($loop, array(
443443
'bindto' => '192.168.0.1:0'
444444
));
445445
```
@@ -478,7 +478,7 @@ Make sure to set up your DNS resolver and underlying TCP connector like this:
478478
$dnsResolverFactory = new React\Dns\Resolver\Factory();
479479
$dns = $dnsResolverFactory->createCached('8.8.8.8', $loop);
480480

481-
$dnsConnector = new React\SocketClient\DnsConnector($tcpConnector, $dns);
481+
$dnsConnector = new React\Socket\DnsConnector($tcpConnector, $dns);
482482

483483
$dnsConnector->connect('www.google.com:80')->then(function (ConnectionInterface $connection) {
484484
$connection->write('...');
@@ -523,7 +523,7 @@ creates a plaintext TCP/IP connection and then enables TLS encryption on this
523523
stream.
524524

525525
```php
526-
$secureConnector = new React\SocketClient\SecureConnector($dnsConnector, $loop);
526+
$secureConnector = new React\Socket\SecureConnector($dnsConnector, $loop);
527527

528528
$secureConnector->connect('www.google.com:443')->then(function (ConnectionInterface $connection) {
529529
$connection->write("GET / HTTP/1.0\r\nHost: www.google.com\r\n\r\n");
@@ -551,7 +551,7 @@ You can optionally pass additional
551551
to the constructor like this:
552552

553553
```php
554-
$secureConnector = new React\SocketClient\SecureConnector($dnsConnector, $loop, array(
554+
$secureConnector = new React\Socket\SecureConnector($dnsConnector, $loop, array(
555555
'verify_peer' => false,
556556
'verify_peer_name' => false
557557
));
@@ -577,7 +577,7 @@ instance and starting a timer that will automatically reject and abort any
577577
underlying connection attempt if it takes too long.
578578

579579
```php
580-
$timeoutConnector = new React\SocketClient\TimeoutConnector($connector, 3.0, $loop);
580+
$timeoutConnector = new React\Socket\TimeoutConnector($connector, 3.0, $loop);
581581

582582
$timeoutConnector->connect('google.com:80')->then(function (ConnectionInterface $connection) {
583583
// connection succeeded within 3.0 seconds
@@ -604,7 +604,7 @@ The `UnixConnector` class implements the
604604
Unix domain socket (UDS) paths like this:
605605

606606
```php
607-
$connector = new React\SocketClient\UnixConnector($loop);
607+
$connector = new React\Socket\UnixConnector($loop);
608608

609609
$connector->connect('/tmp/demo.sock')->then(function (ConnectionInterface $connection) {
610610
$connection->write("HELLO\n");

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"autoload": {
1515
"psr-4": {
16-
"React\\SocketClient\\": "src"
16+
"React\\Socket\\": "src"
1717
}
1818
},
1919
"require-dev": {

examples/01-http.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

33
use React\EventLoop\Factory;
4-
use React\SocketClient\Connector;
5-
use React\SocketClient\ConnectionInterface;
4+
use React\Socket\Connector;
5+
use React\Socket\ConnectionInterface;
66

77
$target = isset($argv[1]) ? $argv[1] : 'www.google.com:80';
88

examples/02-https.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

33
use React\EventLoop\Factory;
4-
use React\SocketClient\Connector;
5-
use React\SocketClient\ConnectionInterface;
4+
use React\Socket\Connector;
5+
use React\Socket\ConnectionInterface;
66

77
$target = isset($argv[1]) ? $argv[1] : 'www.google.com:443';
88

examples/03-netcat.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

33
use React\EventLoop\Factory;
4-
use React\SocketClient\Connector;
5-
use React\SocketClient\ConnectionInterface;
4+
use React\Socket\Connector;
5+
use React\Socket\ConnectionInterface;
66
use React\Stream\ReadableResourceStream;
77
use React\Stream\WritableResourceStream;
88

examples/04-web.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

33
use React\EventLoop\Factory;
4-
use React\SocketClient\ConnectionInterface;
5-
use React\SocketClient\Connector;
4+
use React\Socket\ConnectionInterface;
5+
use React\Socket\Connector;
66
use React\Stream\WritableResourceStream;
77

88
require __DIR__ . '/../vendor/autoload.php';

src/ConnectionInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace React\SocketClient;
3+
namespace React\Socket;
44

55
use React\Stream\DuplexStreamInterface;
66

src/Connector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace React\SocketClient;
3+
namespace React\Socket;
44

55
use React\EventLoop\LoopInterface;
66
use React\Dns\Resolver\Resolver;

src/ConnectorInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace React\SocketClient;
3+
namespace React\Socket;
44

55
/**
66
* The `ConnectorInterface` is responsible for providing an interface for

src/DnsConnector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace React\SocketClient;
3+
namespace React\Socket;
44

55
use React\Dns\Resolver\Resolver;
66
use React\Promise;

0 commit comments

Comments
 (0)