Interface TransportListener
- All Known Implementing Classes:
TransportAdapter
public interface TransportListener
Receives everything the nearby transport has to say. Every method is called on the EDT.
Extend TransportAdapter rather than implementing all of this.
-
Method Summary
Modifier and TypeMethodDescriptionvoidA connection is open in both directions and payloads may be sent.voidconnectionFailed(Endpoint endpoint, NearbyException error) A connection attempt failed, or was rejected by the far side.voidconnectionRequested(IncomingConnection request) A peer wants to connect.voiddisconnected(Endpoint endpoint) An open connection closed, whether deliberately or because the peer went out of range.voidendpointFound(Endpoint endpoint) A peer advertising the same service id came into view.voidendpointLost(Endpoint endpoint) A discovered peer went away before any connection was made.voidpayloadProgress(Endpoint endpoint, PayloadTransferUpdate update) Progress on a payload being sent or received.voidpayloadReceived(Endpoint endpoint, Payload payload) A complete payload arrived.
-
Method Details
-
endpointFound
A peer advertising the same service id came into view. Expect this repeatedly for the same endpoint across discovery sessions.
Parameters
endpoint: the peer that appeared
-
endpointLost
A discovered peer went away before any connection was made.
Parameters
endpoint: the peer that disappeared
-
connectionRequested
A peer wants to connect. Call
IncomingConnection.accept()orIncomingConnection.reject(); a request that is never answered times out on the far side.Parameters
request: the request to answer
-
connected
A connection is open in both directions and payloads may be sent.
Parameters
endpoint: the connected peer
-
connectionFailed
A connection attempt failed, or was rejected by the far side.
Parameters
endpoint: the peer that did not connecterror: why
-
disconnected
An open connection closed, whether deliberately or because the peer went out of range.
Parameters
endpoint: the peer that disconnected
-
payloadReceived
-
payloadProgress
Progress on a payload being sent or received.
Parameters
endpoint: the other end of the transferupdate: how far it has got
-