// end::passive-peer-close[] // tag::passive-peer-open[] /* implementation of MessageEndpointConnection */ public Task Open(IReplicatorConnection connection) { _replicatorConnection = connection; // socket should already be open on the passive side return(Task.FromResult(true)); }
// end::active-peer-close[] // tag::active-peer-open[] /* implementation of MessageEndpointConnection */ public async Task Open(IReplicatorConnection connection) { _replicatorConnection = connection; // await socket.Open(), etc // throw MessagingException if something goes wrong }