1

I have my simulator and phone seeing each other and the one acting as a browser inviting the advertiser into a session. However, the only 2 state changes I see on either side is .Connecting and .NotConnected. I never see .Connected.

Am I supposed to do something to go from .Connecting to .Connected on the advertiser or browser side? I don't see anything in the examples.

I do not have any disconnect statements in my code. Not sure why the connection is being broken.

Aaron Bratcher
  • 6,051
  • 2
  • 39
  • 70
  • 2
    This question and answer is not useful to others because both the question and answer reflect code that is unavailable to view. – dwsolberg Jul 06 '15 at 20:28
  • @dwsolberg Exactly.. Having the same and not sure how to solve.. – Lapidus Jul 12 '15 at 21:22
  • @Lapidus I wrote my own classes instead that work similarly. https://github.com/AaronBratcher/ALBPeerConnection (Need to swap out the socket class for one written in swift still) – Aaron Bratcher Jul 15 '15 at 01:04

1 Answers1

1

Ok I tested your source code and here is how I solved it.

I replaced your varibale 'browserSession.session' with '_serverSession' and both the devices are connected properly and can send Data.

_browser?.invitePeer(device.peerID, toSession: _serverSession, withContext: data, timeout: timeoutTime)

Exclusive sessions are required for each peer to peer connection. Enjoy.

bllakjakk
  • 5,045
  • 1
  • 18
  • 28
  • 1
    I was hoping for a star topology where each browsing device could connect to multiple servers (1 session per server) and each server would have a single session to connect browsers to. – Aaron Bratcher Feb 16 '15 at 15:55