Ejemplo n.º 1
0
        public Session(string apiKey, string sessionId)
        {
            _callbacks = new SessionNative.otc_session_cb();
            _callbacks.on_connected       = on_connected_cb;
            _callbacks.on_stream_received = on_stream_received_cb;
            _callbacks.userData           = (IntPtr)GCHandle.Alloc(this);

            _session = SessionNative.otc_session_new(apiKey, sessionId, ref _callbacks);
        }
Ejemplo n.º 2
0
 public void Dispose()
 {
     ((GCHandle)_callbacks.userData).Free();
     SessionNative.otc_session_delete(_session);
 }
Ejemplo n.º 3
0
 public void Subscribe(ISubscriber subscriber)
 {
     SessionNative.otc_session_subscribe(_session, subscriber.GetNativeReference());
 }
Ejemplo n.º 4
0
 public void Publish(IPublisher publisher)
 {
     SessionNative.otc_session_publish(_session, publisher.GetNativeReference());
 }
Ejemplo n.º 5
0
 public void Connect(string token)
 {
     SessionNative.otc_session_connect(_session, token);
 }