laminar icon indicating copy to clipboard operation
laminar copied to clipboard

Access to Socket's ActiveConnections?

Open CDVoidwalker opened this issue 5 years ago • 2 comments

Access to this as some public function would be very beneficial as it'd allow for broadcasting messages without building your stuff on top of it, cheers.

CDVoidwalker avatar Mar 29 '20 19:03 CDVoidwalker

@CDVoidwalker I was looking at this also, and will probably look at implementing this in the near future. I was talking to @TimonPost and we agreed that we didn't want to expose any of the internals of laminar.

Would something like Socket::get_connection(&self) -> -> impl Iterator<Item=SocketAddr> be sufficient for your purposes?

@TimonPost could you make me the assignee for this issue?

ncallaway avatar Aug 30 '20 23:08 ncallaway

It's been a while since I've looked at the library, but the change you proposed sounds like it'd be sufficient. Some simple broadcasting function just using this get connection and iterating would also be great as I believe that most people do use it this way anyway.

CDVoidwalker avatar Aug 31 '20 00:08 CDVoidwalker