C# 클래스 TrotiNet.HttpSocket

Communication state between two hosts
상속: IDisposable
파일 보기 프로젝트 열기: Gizeta/Nekoxy-fiddler 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
id int

보호된 프로퍼티들

프로퍼티 타입 설명
LowLevelSocket Socket

공개 메소드들

메소드 설명
CloseSocket ( ) : void

Close the internal socket

Dispose ( ) : void

Close the wrapped socket

HttpSocket ( Socket socket ) : System

Wrap a Socket instance into a HttpSocket instance

IsSocketDead ( ) : bool

Returns true if the socket has been closed, or has become unresponsive

ReadAsciiLine ( ) : string

Reads a LF-delimited (or CRLF-delimited) line from the socket, and returns it (without the trailing newline character)

ReadBinary ( ) : uint

Read buffered binary data

A read operation (for instance, ReadAsciiLine) may have loaded the buffer with some data which ended up not being used. If that's the case, then ReadBinary uses it (ReadRaw does not).

Send302 ( ) : void

Send a HTTP 302 redirection over the socket

Send400 ( ) : void

Send a HTTP 400 error over the socket

Send403 ( ) : void

Send a HTTP 403 error over the socket

Send404 ( ) : void

Send a HTTP 404 error over the socket

Send501 ( ) : void

Send a HTTP 501 error over the socket

TunnelChunkedDataTo ( HttpSocket dest ) : void

Tunnel a HTTP-chunked blob of data

The tunneling stops when the last chunk, identified by a size of 0, arrives. The optional trailing entities are also transmitted (but otherwise ignored).

TunnelChunkedDataTo ( MessagePacketHandler mph ) : void

Tunnel a HTTP-chunked blob of data to the specified packet handler

The tunneling stops when the last chunk, identified by a size of 0, arrives. The optional trailing entities are also transmitted (but otherwise ignored).

TunnelDataTo ( HttpSocket dest ) : uint

Transfer data from this socket to the destination socket until this socket closes

TunnelDataTo ( HttpSocket dest, uint nb_bytes ) : uint

Read nb_bytes bytes from the socket, and send it to the destination socket

TunnelDataTo ( MessagePacketHandler mph ) : uint

Transfer data from the socket to the specified packet handler until the socket closes

TunnelDataTo ( MessagePacketHandler mph, byte buffer ) : uint

Sends a buffer to the specified packet handler

TunnelDataTo ( MessagePacketHandler mph, uint nb_bytes ) : uint

Read nb_bytes bytes from the socket, and send it to the specified packet handler

TunnelDataTo ( byte &buffer ) : uint

Fills the buffer with an unknown amount of data from the socket

TunnelDataTo ( byte buffer, uint byte_count ) : uint

Write data from a buffer to the socket

WriteAsciiLine ( string s ) : uint

Write an ASCII string, a CR character, and a LF character to the socket

WriteBinary ( byte b ) : uint

Write an array of bytes to the socket

WriteBinary ( byte b, uint nb_bytes ) : uint

Write the first nb_bytes of b to the socket

WriteBinary ( byte b, uint offset, uint nb_bytes ) : uint

Write nb_bytes of b, starting at offset offset to the socket

보호된 메소드들

메소드 설명
ReadRaw ( ) : uint

Read a block of data from the socket; unread data that was in the buffer is dropped

BufferPosition is reset. If there were unread data in the buffer, it's lost.

비공개 메소드들

메소드 설명
SendHttpError ( string ErrorCodeAndReason ) : void
Trace ( string msg ) : void
TunnelChunkedDataTo ( HttpSocket dest, MessagePacketHandler mph ) : void

메소드 상세

CloseSocket() 공개 메소드

Close the internal socket
public CloseSocket ( ) : void
리턴 void

Dispose() 공개 메소드

Close the wrapped socket
public Dispose ( ) : void
리턴 void

HttpSocket() 공개 메소드

Wrap a Socket instance into a HttpSocket instance
public HttpSocket ( Socket socket ) : System
socket Socket
리턴 System

IsSocketDead() 공개 메소드

Returns true if the socket has been closed, or has become unresponsive
public IsSocketDead ( ) : bool
리턴 bool

ReadAsciiLine() 공개 메소드

Reads a LF-delimited (or CRLF-delimited) line from the socket, and returns it (without the trailing newline character)
public ReadAsciiLine ( ) : string
리턴 string

ReadBinary() 공개 메소드

Read buffered binary data
A read operation (for instance, ReadAsciiLine) may have loaded the buffer with some data which ended up not being used. If that's the case, then ReadBinary uses it (ReadRaw does not).
public ReadBinary ( ) : uint
리턴 uint

ReadRaw() 보호된 메소드

Read a block of data from the socket; unread data that was in the buffer is dropped
BufferPosition is reset. If there were unread data in the buffer, it's lost.
protected ReadRaw ( ) : uint
리턴 uint

Send302() 공개 메소드

Send a HTTP 302 redirection over the socket
public Send302 ( ) : void
리턴 void

Send400() 공개 메소드

Send a HTTP 400 error over the socket
public Send400 ( ) : void
리턴 void

Send403() 공개 메소드

Send a HTTP 403 error over the socket
public Send403 ( ) : void
리턴 void

Send404() 공개 메소드

Send a HTTP 404 error over the socket
public Send404 ( ) : void
리턴 void

Send501() 공개 메소드

Send a HTTP 501 error over the socket
public Send501 ( ) : void
리턴 void

TunnelChunkedDataTo() 공개 메소드

Tunnel a HTTP-chunked blob of data
The tunneling stops when the last chunk, identified by a size of 0, arrives. The optional trailing entities are also transmitted (but otherwise ignored).
public TunnelChunkedDataTo ( HttpSocket dest ) : void
dest HttpSocket The destination socket
리턴 void

TunnelChunkedDataTo() 공개 메소드

Tunnel a HTTP-chunked blob of data to the specified packet handler
The tunneling stops when the last chunk, identified by a size of 0, arrives. The optional trailing entities are also transmitted (but otherwise ignored).
public TunnelChunkedDataTo ( MessagePacketHandler mph ) : void
mph MessagePacketHandler
리턴 void

TunnelDataTo() 공개 메소드

Transfer data from this socket to the destination socket until this socket closes
public TunnelDataTo ( HttpSocket dest ) : uint
dest HttpSocket
리턴 uint

TunnelDataTo() 공개 메소드

Read nb_bytes bytes from the socket, and send it to the destination socket
public TunnelDataTo ( HttpSocket dest, uint nb_bytes ) : uint
dest HttpSocket
nb_bytes uint
리턴 uint

TunnelDataTo() 공개 메소드

Transfer data from the socket to the specified packet handler until the socket closes
public TunnelDataTo ( MessagePacketHandler mph ) : uint
mph MessagePacketHandler
리턴 uint

TunnelDataTo() 공개 메소드

Sends a buffer to the specified packet handler
public TunnelDataTo ( MessagePacketHandler mph, byte buffer ) : uint
mph MessagePacketHandler
buffer byte
리턴 uint

TunnelDataTo() 공개 메소드

Read nb_bytes bytes from the socket, and send it to the specified packet handler
public TunnelDataTo ( MessagePacketHandler mph, uint nb_bytes ) : uint
mph MessagePacketHandler
nb_bytes uint
리턴 uint

TunnelDataTo() 공개 메소드

Fills the buffer with an unknown amount of data from the socket
public TunnelDataTo ( byte &buffer ) : uint
buffer byte data from the socket
리턴 uint

TunnelDataTo() 공개 메소드

Write data from a buffer to the socket
public TunnelDataTo ( byte buffer, uint byte_count ) : uint
buffer byte
byte_count uint
리턴 uint

WriteAsciiLine() 공개 메소드

Write an ASCII string, a CR character, and a LF character to the socket
public WriteAsciiLine ( string s ) : uint
s string
리턴 uint

WriteBinary() 공개 메소드

Write an array of bytes to the socket
public WriteBinary ( byte b ) : uint
b byte
리턴 uint

WriteBinary() 공개 메소드

Write the first nb_bytes of b to the socket
public WriteBinary ( byte b, uint nb_bytes ) : uint
b byte
nb_bytes uint
리턴 uint

WriteBinary() 공개 메소드

Write nb_bytes of b, starting at offset offset to the socket
public WriteBinary ( byte b, uint offset, uint nb_bytes ) : uint
b byte
offset uint
nb_bytes uint
리턴 uint

프로퍼티 상세

LowLevelSocket 보호되어 있는 프로퍼티

Returns the wrapped socket
protected Socket LowLevelSocket
리턴 Socket

id 공개적으로 프로퍼티

Socket UID.
public int id
리턴 int