C# Class BonCodeAJP13.BonCodeAJP13ServerConnection

BonCodeAJP13Connection implements the functionally in the server to manage one connection to Tomcat, its thread will be spawned from the CallHandler
Mostra file Open project: Bilal-S/iis2tomcat Class Usage Examples

Public Methods

Method Description
AddPacketToSendQueue ( BonCodeAJP13.BonCodeAJP13Packet singlePacket ) : void

add a package to the collection of packets to be send to tomcat

BeginConnection ( ) : void

start connection using packages stored in instance

BonCodeAJP13ServerConnection ( ) : System

Generic constuctor. Only initializes intance DEPRECATED DO NOT USE

BonCodeAJP13ServerConnection ( BonCodeAJP13.BonCodeAJP13Packet singlePacket ) : System

Initialize new connection from server to tomcat in new thread. this connection will run in new thread spawned from the listener thread. DEPRECATED DO NOT USE

BonCodeAJP13ServerConnection ( BonCodeAJP13.BonCodeAJP13Packet singlePacket, bool delayConnection = true ) : System

Initialize new connection from server to tomcat in new thread. Delayed connection init. Will wait until connection is initialized DEPRECATED DO NOT USE

BonCodeAJP13ServerConnection ( BonCodeAJP13.BonCodeAJP13PacketCollection packetsToSend ) : System

Initialize new connection from server to tomcat in new thread. We use a packet collection (in case of Form posts) DEPRECATED DO NOT USE

BonCodeAJP13ServerConnection ( string server, int port, BonCodeAJP13.BonCodeAJP13Packet singlePacket ) : System

Initialize new connection to tomcat using server and port input DEPRECATED DO NOT USE

BonCodeAJP13ServerConnection ( string server, int port, BonCodeAJP13.BonCodeAJP13PacketCollection packetsToSend ) : System

Initialize new connection to tomcat using server and port input and packet collection DEPRECATED DO NOT USE

BonCodeAJP13ServerConnection ( string logFilePostFix = "", string clientIp = "" ) : System

Constructor with a post fix for log file names Initializes intance ONLY USE THIS

HandleConnection ( ) : void

Creates TCP/IP Level network connection to Tomcat

Private Methods

Method Description
AnalyzePackage ( bool &delayWriteIndicator, byte receiveBuffer, bool skipFlush = false, int iOffset ) : byte[]

Primary Signature for Analyzing Package. Review received bytes and put them into the package container. Added delayWriteIndicator in case write occured in this context we want to delay writing for POST.

AnalyzePackage ( byte receiveBuffer, bool skipFlush = false, int iOffset ) : byte[]

Alternate Signature, drop reference needed. Review received bytes and put them into the package container This signature is maintained so we don't have to change existing code.

ByteSearch ( byte searchIn, byte searchBytes, int start ) : int

Find byte pattern in given byte array. if not found will return -1. Otherwise will return index of starting match

CheckMutex ( ) : void

prep logging facilities

CloseConnectionNoError ( string message = "Closing Stream" ) : void

Close connection and its Network stream. Everything is OK.

ComunicateWithTomcat ( ) : void
ConnectionError ( ) : void

Close connection and its Network stream and invoke the Connection Returned event with failure string. This function has one override with string that can be passed.

ConnectionError ( string message = "", string messageType = "" ) : void
FlipArray ( byte Data ) : byte[]

Flips the array to send it using the big endian convention

GetInt16B ( byte Data, int Pos ) : int

Get the Int16 value from the array starting from the pos pos Using unsigned integers only range from 0 to 65,535

ProcessFlush ( ) : void

implement delegated call to flush packets upon detection of flush event

ServerPath ( String virtualPath ) : string

implement delegated call to return a physical path for a given virtual path

p_CreateConnection ( BonCodeAJP13.BonCodeAJP13PacketCollection packetsToSend ) : void

Create Actual Connection and initiate wait for response within this thread

p_KeepAliveTimer_Elapsed ( object sender, System e ) : void

Handler for the Keep Alive timer. Close the connection when timer has elapsed.

Method Details

AddPacketToSendQueue() public method

add a package to the collection of packets to be send to tomcat
public AddPacketToSendQueue ( BonCodeAJP13.BonCodeAJP13Packet singlePacket ) : void
singlePacket BonCodeAJP13.BonCodeAJP13Packet
return void

BeginConnection() public method

start connection using packages stored in instance
public BeginConnection ( ) : void
return void

BonCodeAJP13ServerConnection() public method

Generic constuctor. Only initializes intance DEPRECATED DO NOT USE
public BonCodeAJP13ServerConnection ( ) : System
return System

BonCodeAJP13ServerConnection() public method

Initialize new connection from server to tomcat in new thread. this connection will run in new thread spawned from the listener thread. DEPRECATED DO NOT USE
public BonCodeAJP13ServerConnection ( BonCodeAJP13.BonCodeAJP13Packet singlePacket ) : System
singlePacket BonCodeAJP13.BonCodeAJP13Packet
return System

BonCodeAJP13ServerConnection() public method

Initialize new connection from server to tomcat in new thread. Delayed connection init. Will wait until connection is initialized DEPRECATED DO NOT USE
public BonCodeAJP13ServerConnection ( BonCodeAJP13.BonCodeAJP13Packet singlePacket, bool delayConnection = true ) : System
singlePacket BonCodeAJP13.BonCodeAJP13Packet
delayConnection bool
return System

BonCodeAJP13ServerConnection() public method

Initialize new connection from server to tomcat in new thread. We use a packet collection (in case of Form posts) DEPRECATED DO NOT USE
public BonCodeAJP13ServerConnection ( BonCodeAJP13.BonCodeAJP13PacketCollection packetsToSend ) : System
packetsToSend BonCodeAJP13.BonCodeAJP13PacketCollection
return System

BonCodeAJP13ServerConnection() public method

Initialize new connection to tomcat using server and port input DEPRECATED DO NOT USE
public BonCodeAJP13ServerConnection ( string server, int port, BonCodeAJP13.BonCodeAJP13Packet singlePacket ) : System
server string
port int
singlePacket BonCodeAJP13.BonCodeAJP13Packet
return System

BonCodeAJP13ServerConnection() public method

Initialize new connection to tomcat using server and port input and packet collection DEPRECATED DO NOT USE
public BonCodeAJP13ServerConnection ( string server, int port, BonCodeAJP13.BonCodeAJP13PacketCollection packetsToSend ) : System
server string
port int
packetsToSend BonCodeAJP13.BonCodeAJP13PacketCollection
return System

BonCodeAJP13ServerConnection() public method

Constructor with a post fix for log file names Initializes intance ONLY USE THIS
public BonCodeAJP13ServerConnection ( string logFilePostFix = "", string clientIp = "" ) : System
logFilePostFix string
clientIp string
return System

HandleConnection() public method

Creates TCP/IP Level network connection to Tomcat
public HandleConnection ( ) : void
return void