mapConnections

open override fun <T> mapConnections(mapfilter: (P2pClient) -> T?): List<T>

Returns a list of connected peers. This API works simultaneously as map (transformation) and filter functions and calls the passed function on every item in the connection list.

Return

List of whatever your transformation/filter function returned, skipping null

Parameters

mapfilter

: Return T to add it to the returned list, return null skip