Skip to content

Conversation

@thekid
Copy link
Member

@thekid thekid commented Dec 15, 2021

Use select() and test with isConnected() whether a connection has been established after calling this.

use peer\Socket;

$s= new Socket($host, $port);
$s->open();

$read= $write= $error= [$s];
$s->kind()->select($read, $write, $error);

$check= $s->isConnected();
  • peer.Socket
  • peer.BSDSocket

See https://gist.github.com/thekid/0b20593c563fea11def89f861aa2000f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant