Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - (2.0.0-beta) 'node' connection mode #7

Closed

Conversation

lifely
Copy link

@lifely lifely commented Oct 25, 2018

Description

status: last testing stage

This might looks like a lots of change but the pull-request include differents things:

  • new files and update to projects / settings (.gitignore, pod spec, example project, playground)
  • some reoganisation of extensions into new files or re-order of properties of functions
  • update multiple types with news attributes for feature like 'security', 'discoveryInfo' & 'connectionMode'
  • update of the EventProducers for Sessions, Advertiser & Browser

Sessions - MCSession delegate & event producer

PeerSession can represent either a advertiser session (local-service) or a connection to a 'distant-service' invited through PeerBrowser

thus we now have access to the following attributes:

  • sessionPeer - indicate this is a distance-service-session and represent the peer advertising that servicer
  • isLocalServiceSession - computed property that check peer against peerSession
  • isDistantServiceSession - computed property too

PeerSession can now take security parameter at init allowing to configurer the kind of security to use on the MCSession

Advertisers - MCNearbyServiceAdvertiser delegate & event producer

Advertiser didn't change too much, we can now use discoverInfo at init which couple with Peer.context allow better introspection of services and peer.

Before we used poorly named service to differentiate environment or restaurants, now we can name our services simply and use discoveryInfo to filter matching services.

Browser - MCNearbyServiceBrowser delegate & event producer

Main change to browser is the new sessionFactory logic introduced.
The browser will use the sessions attribute when uses as a single slave connection,
but will create new session through the factory if configured as node browser.

This will allow to create new session for each services we're connecting to.

Julien Di Marco and others added 18 commits April 16, 2018 16:40
…' in closure definition '() -> Void' and cleanup other broken things
…ce a tuple of 'session, PeerSessionEvent'

PeerSession is also improved and include more information on the session (it's kind node or slave and status 'available','unavailable'
Session factory is used for 'node' PeerConnectionManager 'mode', allow to create session when then main session is used as advertiser
… logic

Manager now offer three connection modes, 'master', 'node' and 'none'

The goal is to still use 'PeerConnectionManager' as a standalone components than handle all multipeer connectivity abstraction

In '.node' mode the manager will manage a unique 'session' for the service advertise, session will then be created for any other services connected through PeerBrowser
@lifely lifely closed this Oct 25, 2018
@rchatham
Copy link
Owner

rchatham commented Oct 26, 2018

@lifely This looks super interesting! Very interested and thank you for contributing!

@Geoffrey-T Geoffrey-T deleted the feature/node-mode-integration branch December 6, 2018 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants