Class TransportAdapter
java.lang.Object
com.codename1.nearby.transport.TransportAdapter
- All Implemented Interfaces:
TransportListener
A
TransportListener whose methods all do nothing, so a caller
interested in two events overrides two methods.-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
TransportAdapter
public TransportAdapter()
-
-
Method Details
-
endpointFound
Description copied from interface:TransportListenerA 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
- Specified by:
endpointFoundin interfaceTransportListener
-
endpointLost
Description copied from interface:TransportListenerA discovered peer went away before any connection was made.
Parameters
endpoint: the peer that disappeared
- Specified by:
endpointLostin interfaceTransportListener
-
connectionRequested
Description copied from interface:TransportListenerA 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
- Specified by:
connectionRequestedin interfaceTransportListener
-
connected
Description copied from interface:TransportListenerA connection is open in both directions and payloads may be sent.
Parameters
endpoint: the connected peer
- Specified by:
connectedin interfaceTransportListener
-
connectionFailed
Description copied from interface:TransportListenerA connection attempt failed, or was rejected by the far side.
Parameters
endpoint: the peer that did not connecterror: why
- Specified by:
connectionFailedin interfaceTransportListener
-
disconnected
Description copied from interface:TransportListenerAn open connection closed, whether deliberately or because the peer went out of range.
Parameters
endpoint: the peer that disconnected
- Specified by:
disconnectedin interfaceTransportListener
-
payloadReceived
Description copied from interface:TransportListenerA complete payload arrived.
Parameters
endpoint: who sent itpayload: what they sent
- Specified by:
payloadReceivedin interfaceTransportListener
-
payloadProgress
Description copied from interface:TransportListenerProgress on a payload being sent or received.
Parameters
endpoint: the other end of the transferupdate: how far it has got
- Specified by:
payloadProgressin interfaceTransportListener
-