1 package Object::Remote::Connector::TCP;
6 with 'Object::Remote::Role::Connector';
8 has host => (is => 'ro', required => 1);
9 has port => (is => 'ro', required => 1);
10 has sock => (is => 'rw');
15 push @Object::Remote::Connection::Guess, sub {
17 # FIXME: Use Regexp::Common regex for a hostname, or check this against spec.
18 print STDERR "tcp guess for $_\n";
19 if (defined and !ref and m!^tcp://([a-z0-9.]+):(\d+)/!i) {
20 return __PACKAGE__->new(host => $1, port => $2);
29 my $sock = IO::Socket::INET->new(PeerHost => $self->host, PeerPort => $self->port)
30 or die "Couldn't open connection: $!";
32 ($sock, $sock, undef);