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