Instance Method

session:didReceiveStream:withName:fromPeer:

Called when a nearby peer opens a byte stream connection to the local peer.

Required.

Declaration

- (void)session:(MCSession *)session didReceiveStream:(NSInputStream *)stream withName:(NSString *)streamName fromPeer:(MCPeerID *)peerID;

Parameters

session

The session through which the byte stream was opened.

stream

An NSInputStream object that represents the local endpoint for the byte stream.

streamName

The name of the stream, as provided by the originator.

peerID

The peer ID of the originator of the stream.

See Also

MCSession Delegate Methods

- session:didReceiveData:fromPeer:

Indicates that an NSData object has been received from a nearby peer.

Required.

- session:didStartReceivingResourceWithName:fromPeer:withProgress:

Indicates that the local peer began receiving a resource from a nearby peer.

Required.

- session:didFinishReceivingResourceWithName:fromPeer:atURL:withError:

Indicates that the local peer finished receiving a resource from a nearby peer.

Required.

- session:peer:didChangeState:

Called when the state of a nearby peer changes.

Required.

- session:didReceiveCertificate:fromPeer:certificateHandler:

Called to validate the client certificate provided by a peer when the connection is first established.