Dispose() публичный Метод

public Dispose ( ) : void
Результат void
Пример #1
0
 public void ListenerCanCreateAndDispose()
 {
     var engine = new KestrelEngine(LibraryManager, new ShutdownNotImplemented());
     engine.Start(1);
     var started = engine.CreateServer("http", "localhost", 54321, App);
     started.Dispose();
     engine.Dispose();
 }
Пример #2
0
        public void ConnectionCanReadAndWrite()
        {
            var engine = new KestrelEngine(LibraryManager, new ShutdownNotImplemented());
            engine.Start(1);
            var started = engine.CreateServer("http", "localhost", 54321, App);

            Console.WriteLine("Started");
            var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            socket.Connect(new IPEndPoint(IPAddress.Loopback, 54321));
            socket.Send(Encoding.ASCII.GetBytes("POST / HTTP/1.0\r\n\r\nHello World"));
            socket.Shutdown(SocketShutdown.Send);
            var buffer = new byte[8192];
            for (; ;)
            {
                var length = socket.Receive(buffer);
                if (length == 0) { break; }
                var text = Encoding.ASCII.GetString(buffer, 0, length);
            }
            started.Dispose();
            engine.Dispose();
        }
Пример #3
0
 public void EngineCanStartAndStop()
 {
     var engine = new KestrelEngine(LibraryManager, new ShutdownNotImplemented());
     engine.Start(1);
     engine.Dispose();
 }
Пример #4
0
 public void EngineCanStartAndStop(ServiceContext testContext)
 {
     var engine = new KestrelEngine(testContext);
     engine.Start(1);
     engine.Dispose();
 }
Пример #5
0
 public void ListenerCanCreateAndDispose(ServiceContext testContext)
 {
     var engine = new KestrelEngine(testContext);
     engine.Start(1);
     var address = ServerAddress.FromUrl("http://localhost:54321/");
     var started = engine.CreateServer(address, App);
     started.Dispose();
     engine.Dispose();
 }
Пример #6
0
        public void ConnectionCanReadAndWrite(ServiceContext testContext)
        {
            var engine = new KestrelEngine(testContext);
            engine.Start(1);
            var address = ServerAddress.FromUrl("http://localhost:54321/");
            var started = engine.CreateServer(address, App);

            Console.WriteLine("Started");
            var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            socket.Connect(new IPEndPoint(IPAddress.Loopback, 54321));
            socket.Send(Encoding.ASCII.GetBytes("POST / HTTP/1.0\r\n\r\nHello World"));
            socket.Shutdown(SocketShutdown.Send);
            var buffer = new byte[8192];
            while (true)
            {
                var length = socket.Receive(buffer);
                if (length == 0) { break; }
                var text = Encoding.ASCII.GetString(buffer, 0, length);
            }
            started.Dispose();
            engine.Dispose();
        }
Пример #7
0
 public void ListenerCanCreateAndDispose()
 {
     var engine = new KestrelEngine(LibraryManager, new TestServiceContext());
     engine.Start(1);
     var started = engine.CreateServer("http", "localhost", 54321, App);
     started.Dispose();
     engine.Dispose();
 }
Пример #8
0
 public void EngineCanStartAndStop()
 {
     var engine = new KestrelEngine(LibraryManager, new TestServiceContext());
     engine.Start(1);
     engine.Dispose();
 }
Пример #9
0
 public async Task ListenerCanCreateAndDispose()
 {
     var engine = new KestrelEngine(LibraryManager);
     engine.Start(1);
     var started = engine.CreateServer("http", "localhost", 54321, App);
     started.Dispose();
     engine.Dispose();
 }
Пример #10
0
 public async Task EngineCanStartAndStop()
 {
     var engine = new KestrelEngine(LibraryManager);
     engine.Start(1);
     engine.Dispose();
 }