Beispiel #1
0
        public static QuicheConnection Connect(
            string serverName, byte[] scid, QuicheConfig config)
        {
            var conn = NativeMethods.quiche_connect(
                serverName, scid, (ulong)scid.Length, config.Config);

            return(new QuicheConnection(conn));
        }
Beispiel #2
0
        public static QuicheConnection Accept(
            byte[] scid, byte[] odcid, QuicheConfig config)
        {
            var conn = NativeMethods.quiche_accept(
                scid, (ulong)scid.Length, odcid, (ulong)odcid.Length, config.Config);

            return(new QuicheConnection(conn));
        }
Beispiel #3
0
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                // dispose managed resource
                if (disposing)
                {
                    if (Config != null)
                    {
                        Config.Dispose();
                        Config = null;
                    }
                }

                _disposed = true;
            }
        }
Beispiel #4
0
        public static QuicheConnection WithTls(
            byte[] scid,
            byte[] odcid,
            QuicheConfig config,
            byte[] ssl,
            bool isServer)
        {
            var ptr = Marshal.AllocCoTaskMem(ssl.Length);

            Marshal.Copy(ssl, 0, ptr, ssl.Length);
            var conn = NativeMethods.quiche_conn_new_with_tls(
                scid, (ulong)scid.Length,
                odcid, (ulong)odcid.Length,
                config.Config,
                ptr,
                isServer);

            Marshal.FreeCoTaskMem(ptr);
            return(new QuicheConnection(conn));
        }
Beispiel #5
0
 public QuicheClient(QuicheConfig config)
 {
     Config = config;
 }
Beispiel #6
0
 public QuicheListener(QuicheConfig config)
 {
     Config = config;
 }