Open wwiillllii opened 9 years ago
If a disconnect event occurred, the disconnect has already happened. Maybe a listener sends an object to all connections, in which case it should not send to the disconnected connection.
The connection doesn't have an address because it isn't connected. You could always store additional information for a connection, such as the last connected address.
On Wed, Feb 11, 2015 at 8:30 PM, wwiillllii notifications@github.com wrote:
public void disconnected (Connection connection) { removeConnection(connection); Listener[] listeners = Server.this.listeners; for (int i = 0, n = listeners.length; i < n; i++) listeners[i].disconnected(connection); }
shouldn't the connection be removed only after all the listeners were called? if the connection is removed before, the other listeners may not have the data the need, for example the connection's address.
— Reply to this email directly or view it on GitHub https://github.com/EsotericSoftware/kryonet/issues/84.
shouldn't the connection be removed only after all the listeners were called? if the connection is removed before, the other listeners may not have the data the need, for example the connection's address.