C# Class TrotiNet.Test.TcpCommon

Common utility code for TCP and HTTP tests
Mostrar archivo Open project: Gizeta/Nekoxy-fiddler Class Usage Examples

Public Methods

Method Description
DoMsgRoundTrip ( string msg_send, string msg_expect ) : void

Send a message through the TCP channel, and expect it to return unchanged

Useful for testing I/O levels 1 and 2. This method must be called between Setup() and TearDown().

ParseHttpHeaders ( string header ) : HttpHeaders

Parse a HTTP header after sending it through the TCP channel

This method must be called between Setup() and TearDown().

ParseHttpRequestLine ( string rq_line ) : HttpRequestLine

Parse a HTTP header after sending it through the TCP channel

This method must be called between Setup() and TearDown().

ParseHttpStatusLine ( string status_line ) : HttpStatusLine

Parse a HTTP status line after sending it through the TCP channel

This method must be called between Setup() and TearDown().

Setup ( bool UseIPv6 ) : void

Set up a simple server that echoes everything it receives back to the sender

TearDown ( ) : void

Stop the server started by Setup()

Method Details

DoMsgRoundTrip() public static method

Send a message through the TCP channel, and expect it to return unchanged
Useful for testing I/O levels 1 and 2. This method must be called between Setup() and TearDown().
public static DoMsgRoundTrip ( string msg_send, string msg_expect ) : void
msg_send string
msg_expect string
return void

ParseHttpHeaders() public static method

Parse a HTTP header after sending it through the TCP channel
This method must be called between Setup() and TearDown().
public static ParseHttpHeaders ( string header ) : HttpHeaders
header string
return HttpHeaders

ParseHttpRequestLine() public static method

Parse a HTTP header after sending it through the TCP channel
This method must be called between Setup() and TearDown().
public static ParseHttpRequestLine ( string rq_line ) : HttpRequestLine
rq_line string
return TrotiNet.HttpRequestLine

ParseHttpStatusLine() public static method

Parse a HTTP status line after sending it through the TCP channel
This method must be called between Setup() and TearDown().
public static ParseHttpStatusLine ( string status_line ) : HttpStatusLine
status_line string
return TrotiNet.HttpStatusLine

Setup() public static method

Set up a simple server that echoes everything it receives back to the sender
public static Setup ( bool UseIPv6 ) : void
UseIPv6 bool
return void

TearDown() public static method

Stop the server started by Setup()
public static TearDown ( ) : void
return void