Socket
Socket copied to clipboard
Fix node remote address
This PR fix the bug related to the remote address of a connection.
- As the Server handle multiple connections, it must keep the remote of each node.
ping?
Thanks for the reminder, I will check soon for implement into the node.
Coverage decreased (-0.4%) to 87.427% when pulling 848c53127342fb2563a1754f2fbbdaf8a21cdd8f on Pierozi:fix/node-remote-address into 98199af6fbbd5fc5280861043127b94e1fce5e91 on hoaproject:master.
Coverage decreased (-0.4%) to 87.427% when pulling 48bc77acd1972a492d9fdf3d1990a84a95ce1719 on Pierozi:fix/node-remote-address into 98199af6fbbd5fc5280861043127b94e1fce5e91 on hoaproject:master.
@Hywan I've made change in order to use \Hoa\Socket\Node
the design and logic are much better like this.
@Hywan address on stream_socket_recvfrom
isn't working properly, return empty string.
I've a concern regarding the implementation of new method getPeerName
if the developer has implemented his own Node, this would break the behavior.
Options regarding possible BC break.
- make
getRemoteAddress
compatible if Node does not have methodgetPeerName
The overhead is minimal like it's one line of code to do the job. - Create an Abstract class of Node, and encourage people to extend it for their own node.
@hoaproject/hoackers thought?
There is already an abstract node class: Node
:-].
I don't like having method_exists
checks, this is ugly, slow, and error-prone. Let's add it, or break it with PHP 5.x drop.
Vote for Break it :+1:
@Hywan Ping status?, I have another PR that will concerne same piece of code.
Now that hoa/option
is about to be released, we will start to introduce BC break. I will focus on hoa/socket
as soon as possible (we need to release other libraries before, but I can lead my work to hoa/socket
first).