HttpResponse.Close HttpResponse.Close HttpResponse.Close HttpResponse.Close Method

定义

关闭到客户端的套接字连接。Closes the socket connection to a client.

public:
 void Close();
public void Close ();
member this.Close : unit -> unit
Public Sub Close ()

注解

此方法会以突然的方式终止与客户端的连接,而不是用于正常的 HTTP 请求处理。This method terminates the connection to the client in an abrupt manner and is not intended for normal HTTP request processing. 方法将重置数据包发送到客户端,这可能会导致在服务器上、客户端或之间的某个位置缓冲的响应数据被删除。The method sends a reset packet to the client, which can cause response data that is buffered on the server, the client, or somewhere in between to be dropped.

但是,如果要跳转CompleteRequest EndRequest到事件并向客户端发送响应,则通常应调用。However, typically you should call CompleteRequest instead if you want to jump ahead to the EndRequest event and send a response to the client.

适用于