示例#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);
        }
示例#2
0
 public void Dispose()
 {
     ((GCHandle)_callbacks.userData).Free();
     SessionNative.otc_session_delete(_session);
 }
示例#3
0
 public void Subscribe(ISubscriber subscriber)
 {
     SessionNative.otc_session_subscribe(_session, subscriber.GetNativeReference());
 }
示例#4
0
 public void Publish(IPublisher publisher)
 {
     SessionNative.otc_session_publish(_session, publisher.GetNativeReference());
 }
示例#5
0
 public void Connect(string token)
 {
     SessionNative.otc_session_connect(_session, token);
 }