AnyEvent-WebSocket-Server

 view release on metacpan or  search on metacpan

t/error.t  view on Meta::CPAN

            shutdown $server_fh, 2;
            undef $server_fh;
            $handle->push_shutdown();
            $cv_client_finish->recv;
        }else {
            my $server_handle = AnyEvent::Handle->new(
                fh => $server_fh,
                on_error => sub { fail("server handle error: $_[2]") },
            );
            my $send_response =
                "HTTP/1.1 404 Not Found\r\n" .
                "Connection: close\r\n" .
                "Content-Type: text/plain\r\n" .
                "Content-Length: 9\r\n" .
                "\r\n".
                "Not Found";
            $server_handle->push_write($send_response);
            $server_handle->push_shutdown();
            $cv_client_finish->recv;

            is($got_response, $send_response, "server fh remains intact in this case, so the server can send a valid HTTP response.");



( run in 0.866 second using v1.01-cache-2.11-cpan-39bf76dae61 )