Skip to main content

EOS_P2P_AcceptConnection

Function EOS_P2P_AcceptConnection 

Source
pub unsafe extern "C" fn EOS_P2P_AcceptConnection(
    Handle: EOS_HP2P,
    Options: *const EOS_P2P_AcceptConnectionOptions,
) -> EOS_EResult
Expand description

Accept or Request a connection with a specific peer on a specific Socket ID.

If this connection was not already locally accepted, we will securely message the peer, and trigger a PeerConnectionRequest notification notifying them of the connection request. If the PeerConnectionRequest notification is not bound for all Socket IDs or for the requested Socket ID in particular, the request will be silently ignored.

If the remote peer accepts the connection, a notification will be broadcast to the EOS_P2P_AddNotifyPeerConnectionEstablished when the connection is ready to send packets.

If multiple Socket IDs are accepted with one peer, they will share one physical socket.

Even if a connection is already locally accepted, EOS_Success will still be returned if the input was valid.

@param Options Information about who would like to accept a connection, and which connection @return EOS_EResult containing the result of the operation. Possible result codes:

  • EOS_Success - if the provided data is valid
  • EOS_InvalidParameters - if the provided data is invalid

@see EOS_P2P_AcceptConnectionOptions