Skip to content

Commit

Permalink
Rename SocketServer to ServerSocket
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Jan 31, 2023
1 parent d84051b commit d43bbbe
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Revolt\EventLoop;
use Revolt\EventLoop\Suspension;

final class ResourceSocketServer implements SocketServer, ResourceStream
final class ResourceServerSocket implements ServerSocket, ResourceStream
{
use ForbidCloning;
use ForbidSerialization;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Amp\ForbidCloning;
use Amp\ForbidSerialization;

final class ResourceSocketServerFactory implements SocketServerFactory
final class ResourceServerSocketFactory implements ServerSocketFactory
{
use ForbidCloning;
use ForbidSerialization;
Expand All @@ -20,7 +20,7 @@ public function __construct(private readonly ?int $chunkSize = null)
/**
* @throws SocketException
*/
public function listen(SocketAddress|string $address, ?BindContext $bindContext = null): ResourceSocketServer
public function listen(SocketAddress|string $address, ?BindContext $bindContext = null): ResourceServerSocket
{
$bindContext ??= new BindContext;

Expand Down Expand Up @@ -58,6 +58,6 @@ public function listen(SocketAddress|string $address, ?BindContext $bindContext
), $errno);
}

return new ResourceSocketServer($server, $bindContext, $this->chunkSize ?? ResourceSocket::DEFAULT_CHUNK_SIZE);
return new ResourceServerSocket($server, $bindContext, $this->chunkSize ?? ResourceSocket::DEFAULT_CHUNK_SIZE);
}
}
2 changes: 1 addition & 1 deletion src/SocketServer.php → src/ServerSocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Amp\Cancellation;
use Amp\Closable;

interface SocketServer extends Closable
interface ServerSocket extends Closable
{
/**
* @throws PendingAcceptError If another accept request is pending.
Expand Down
4 changes: 2 additions & 2 deletions src/SocketServerFactory.php → src/ServerSocketFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Amp\Socket;

interface SocketServerFactory
interface ServerSocketFactory
{
/**
* @throws SocketException
*/
public function listen(SocketAddress|string $address, ?BindContext $bindContext = null): SocketServer;
public function listen(SocketAddress|string $address, ?BindContext $bindContext = null): ServerSocket;
}
4 changes: 2 additions & 2 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ function listen(
SocketAddress|string $address,
?BindContext $bindContext = null,
int $chunkSize = ResourceSocket::DEFAULT_CHUNK_SIZE
): ResourceSocketServer {
return (new ResourceSocketServerFactory($chunkSize))->listen($address, $bindContext);
): ResourceServerSocket {
return (new ResourceServerSocketFactory($chunkSize))->listen($address, $bindContext);
}

/**
Expand Down

0 comments on commit d43bbbe

Please sign in to comment.