예제 #1
0
        public bool Connect()
        {
            var isCallbakOk = this.SetupConnectionCallback();

            this.LastResult = EntryPoint.Connect(this.PathToQuik);
            return(this.LastResult.ReturnValue.IsSuccess && isCallbakOk);
        }
예제 #2
0
        public async Task Begin()
        {
            EntryPoint[] points = await NRL.FindEntryPoints();

            if (points.Length == 0)
            {
                Log.Error("Unable to locate an available entry point");
                return;
            }

            EntryP = points[0];
            Log.Information("Connecting to entry point {Id}", EntryP.Certificate.Subject);
            Packet.StorePacketRoutine(PackType.TCP_S_HELLO, OnConnect);
            Packet.StorePacketRoutine(PackType.TCP_CS_SOCKET_DATA, EntryPoint.StandardDataHandler);
            Packet.StorePacketRoutine(PackType.TCP_CS_SOCKET_CONTROL, EntryPoint.StandardSocketControlHandler);
            await EntryP.Connect(null);

            await Task.Delay(-1);
        }