示例#1
0
        /// <summary>
        /// This is the function used to initiate the chain of callbacks that will allow the user of the
        /// sdk to actually establish connectivity.
        ///
        /// Two callbacks must be provided in this function which will allows the callee to control the
        /// data flow. <see cref="onConnected"/> will be called first and only once. After which <see cref="onData"/>
        /// may be called repeatedly.
        /// </summary>
        /// <param name="onConnected">A callback which is called after the Dial function completes. This callback
        /// will contain the result of the invocation. It is highly recommend to verify the result of the function.</param>
        /// <param name="onData">A callback called whenever data arrives on the connection</param>
        public void Dial(OnZitiConnected onConnected, OnZitiDataReceived onData)
        {
            this.onConnected = onConnected;
            this.onData      = onData;
            ZitiConnection conn = new ZitiConnection(this, zitiContext, "this is context in my connection");

            this.conn = conn;
            Native.API.ziti_dial(conn.nativeConnection, Name, conn_cb, data_cb);
        }
示例#2
0
        public void Dial(OnZitiConnected onConnected, OnZitiDataReceived dataReceived)
        {
            DialEncapsulation de = new DialEncapsulation();

            de.conn         = this;
            de.onConnected  = onConnected;
            de.dataReceived = dataReceived;
            de.dial(Service.Name);
            isDialed = true;
        }