Comments (4)
This is also covered by our test suite: https://github.com/reactphp/socket-client/blob/f905ec2a576b1242b10d5c1dbd2f0eb4fcea7f0c/tests/TcpConnectorTest.php#L12-L21
Are you sure there's nothing listening on this port? :-)
$ sudo netstat -tulpn | grep :8080
from socket-client.
netstat: n: unknown or uninstrumented protocol
I found the issue however...I have a VirtualBox instance that is forwarding 8080 to a guest OS but the guest OS doesn't have a service listening to the forwarded port. I'm not sure what state the host port is in, but it's not connectable...telnet 127.0.0.1 8080
returns:
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
from socket-client.
it's not connectable
Connected to localhost.
Connection closed by foreign host.
This means the port is in fact open and you just did connect successfully. And after connecting, the server immediately closed your connection.
FWIW: You can also reproduce this with a simple server like this:
$server = new Server($loop);
$server->on('connection', function ($conn) {
$conn->close();
});
$server->listen(8080);
This behavior is in line with how all low-level socket functions work (socket_connect()
, fsockopen()
, stream_socket_client()
etc.), so I'm all for keeping this as-is.
from socket-client.
ugh...I didn't have a close handler in my lib until after the higher level protocol was established...totally missed a close call was being emitted from the stream
from socket-client.
Related Issues (20)
- Support Promise cancellation HOT 4
- Return Connection object which exposes remote address HOT 4
- Streams closed while data still in buffer HOT 3
- Gzip Decompress HOT 1
- Connection doesn't time out when using SSL HOT 1
- SNI_server_name is deprecated HOT 1
- SSL Buffer Drain: The Redux HOT 23
- loop response HOT 1
- Certain (older) PHP versions ignore SSL option verify_peer=true HOT 1
- Backport v0.5.0 fixes to v0.4 branch HOT 2
- [Question] Can I Query LDAP after successfully connecting? HOT 1
- Keep connection open HOT 1
- Support for delayed secure connections (STARTTLS) HOT 4
- How to recieve data? HOT 1
- Server Name Indication (SNI) issues on legacy PHP < 5.6
- Merge into Socket component and deprecate SocketClient component HOT 1
- Roadmap to stable v1.0.0 HOT 7
- Abandon package on packagist HOT 3
- Connector 怎么实现重连机制 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from socket-client.