… | |
… | |
50 | }; |
50 | }; |
51 | } |
51 | } |
52 | |
52 | |
53 | sub _sa($$$) { |
53 | sub _sa($$$) { |
54 | my ($host, $port, $proto) = @_; |
54 | my ($host, $port, $proto) = @_; |
|
|
55 | $port or $host =~ s/:([^:]+)$// and $port = $1; |
55 | my $_proto = _proto($proto); |
56 | my $_proto = _proto($proto); |
56 | my $_port = _port($port, $proto); |
57 | my $_port = _port($port, $proto); |
57 | |
58 | |
58 | # optimize this a bit for a common case |
59 | # optimize this a bit for a common case |
59 | if ($host =~ /^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9][0-9]?) |
60 | if ($host =~ /^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9][0-9]?) |
… | |
… | |
77 | If the host is unreachable or otherwise cannot be connected to this method |
78 | If the host is unreachable or otherwise cannot be connected to this method |
78 | returns undef. On all other errors ot croak's. |
79 | returns undef. On all other errors ot croak's. |
79 | |
80 | |
80 | Multihomed is always enabled. |
81 | Multihomed is always enabled. |
81 | |
82 | |
82 | $fh = new_inet Coro::Socket PeerHost => "localhost", PeerPort => 'finger'; |
83 | $fh = new Coro::Socket PeerHost => "localhost", PeerPort => 'finger'; |
83 | |
84 | |
84 | =cut |
85 | =cut |
85 | |
86 | |
86 | sub _prepare_socket { |
87 | sub _prepare_socket { |
87 | my ($class, $arg) = @_; |
88 | my ($class, $arg) = @_; |