Difference between revisions of "Midware TClientWSocket"

From Overbyte
Jump to navigation Jump to search
(Created page with ' Main page -> Midware component reference -> TClientWSocket == Overview == {| | '''unit''' ||…')
 
Line 21: Line 21:
 
| valign="top" | [[Midware_TClientWSocket.CommandTimeout | CommandTimeout]] |||| Timeout value.
 
| valign="top" | [[Midware_TClientWSocket.CommandTimeout | CommandTimeout]] |||| Timeout value.
 
|-
 
|-
| valign="top" | [[Midware_TClientWSocket.ConnectedSinze | ConnectedSinze]] |||| Gives the time when the client connected.         
+
| valign="top" | [[Midware_TClientWSocket.ConnectedSince | ConnectedSince]] |||| Gives the time when the client connected.         
 
|-
 
|-
 
| valign="top" | [[Midware_TClientWSocket.HSocket | HSocket]] |||| HSocket is the underlaying winsock DLL handle for the connection handled by TClientWSocket component.
 
| valign="top" | [[Midware_TClientWSocket.HSocket | HSocket]] |||| HSocket is the underlaying winsock DLL handle for the connection handled by TClientWSocket component.
 
|-
 
|-
| valign="top" | [[Midware_TClientWSocket.Request | Request]] |||| The request property holds the parameters sent to the application server.  
+
| valign="top" | [[Midware_TClientWSocket.LastCommandTime | LastCommandTime]] |||| Gives the time of the last command received from client.
 
|-
 
|-
| valign="top" | [[Midware_TClientWSocket.RequestBody | RequestBody]] |||| RequestBody gives the address where the message body is stored just before sending it to the application server.  
+
| valign="top" | [[Midware_TClientWSocket.LocalPort | LocalPort]] |||| LocalPort gives the port number (or service name) associated by winsock on the local computer for the connection made by client.
 
|-
 
|-
| valign="top" | [[Midware_TClientWSocket.RequestBodyLen | RequestBodyLen]] |||| RequestBodyLen gives the message body length just before sending it to the application server.
+
| valign="top" | [[Midware_TClientWSocket.PeerAddr | PeerAddr]] |||| Store the client's IP address.
 
|-
 
|-
| valign="top" | [[Midware_TClientWSocket.RequestHeader | RequestHeader]] |||| RequestHeader gives the address where the message header is stored just before sending it to the application server.
+
| valign="top" | [[Midware_TClientWSocket.RcvBuf | RcvBuf]] |||| The actual buffer used to store incomming data.
 
|-
 
|-
| valign="top" | [[Midware_TClientWSocket.RequestHeaderLen | RequestHeaderLen]] |||| RequestHeaderLen gives the message header length just before sending it to the application server.
+
| valign="top" | [[Midware_TClientWSocket.RcvSizeInc | RcvSizeInc]] |||| When RcvBuf is too small, it will be enlarged by RcvSizeInc bytes automatically until RcvSizeMax is reached.
 
|-
 
|-
| valign="top" | [[Midware_TClientWSocket.Server | Server]] |||| This is the IP address or hostname for the application server.  
+
| valign="top" | [[Midware_TClientWSocket.RcvSizeMax | RcvSizeMax]] |||| When RcvBuf is too small, it will be enlarged by RcvSizeInc bytes automatically until RcvSizeMax is reached.
 
|-
 
|-
| valign="top" | [[Midware_TClientWSocket.SocksAuthentication | SocksAuthentication]] |||| SocksAuthentication specifies which socks5 authentication method to use.
+
| valign="top" | [[Midware_TClientWSocket.ReplyHeader | ReplyHeader]] |||| ReplyHeader point to the header built by the TAppServer based on reply status.
 
|-
 
|-
| valign="top" | [[Midware_TClientWSocket.SocksPassword | SocksPassword]] |||| SocksPassword is the password used for Socks5 connection.
+
| valign="top" | [[Midware_TClientWSocket.ReplyHeaderLen | ReplyheaderLen]] |||| ReplyHeaderLen is the length in byte for the header.  
 
|-
 
|-
| valign="top" | [[Midware_TClientWSocket.SocksPort| SocksPort]] |||| Socks5 port number.
+
| valign="top" | [[Midware_TClientWSocket.ReplyBody | ReplyBody]] |||| ReplyBody point to the answer to be sent to the client.
 
|-
 
|-
| valign="top" | [[Midware_TClientWSocket.SocksServer | SocksServer]] |||| IP or hostname for socks5 server.
+
| valign="top" | [[Midware_TClientWSocket.ReplyBodyLen | ReplyBodyLen]] |||| ReplyBodyLen is the length in bytes for the answer.  
 
|-
 
|-
| valign="top" | [[Midware_TClientWSocket.SocksUsercode | SocksUsercode]] |||| Socks5 usercode.
+
| valign="top" | [[Midware_TClientWSocket.UserData | UserData]] |||| UserData is not used by the component nor the TAppServer component.  
|-
 
| valign="top" | [[Midware_TClientWSocket.State | Stade]] |||| State property gives the component state:
 
|-
 
| valign="top" | [[Midware_TClientWSocket.WSocket | WSocket]] |||| WSocket is the reference to the underlaiying TWSocket component used for communication with the application server.
 
 
|-
 
|-
 
|}
 
|}

Revision as of 11:06, 4 May 2011

Main page -> Midware component reference -> TClientWSocket

Overview

unit ApSrvCli.pas

TClientWSocket is a specialized TWSocket used to handle client connection with application server. A new TClientWSocket is instanciated by TAppServer when a client connect to the server. TClientWSocket is destroyed after client disconnect.

Do not confuse TClientWSocket with TAppSrvClient which is the client application side. TClientWSocket is used on the server side to handle client connections, TAppSrvClient is used on the client side to connect to the application server. Both components are talking to each other.

User code in an ordinary application server never create a TClientWSocket instance. Instead, it uses instances created by TAppServer and accessed thru his ClientWSocket indexed property or thru reference passed by events such as OnClientCommand.

Properties

Banner The banner to be sent to the client upon connection. Must be a single line.
Busy Busy is TRUE while a the previous request is still executing.
CommandCount Number of commands issued by the client. Useful for statistics or accounting purposes.
CommandTimeout Timeout value.
ConnectedSince Gives the time when the client connected.
HSocket HSocket is the underlaying winsock DLL handle for the connection handled by TClientWSocket component.
LastCommandTime Gives the time of the last command received from client.
LocalPort LocalPort gives the port number (or service name) associated by winsock on the local computer for the connection made by client.
PeerAddr Store the client's IP address.
RcvBuf The actual buffer used to store incomming data.
RcvSizeInc When RcvBuf is too small, it will be enlarged by RcvSizeInc bytes automatically until RcvSizeMax is reached.
RcvSizeMax When RcvBuf is too small, it will be enlarged by RcvSizeInc bytes automatically until RcvSizeMax is reached.
ReplyHeader ReplyHeader point to the header built by the TAppServer based on reply status.
ReplyheaderLen ReplyHeaderLen is the length in byte for the header.
ReplyBody ReplyBody point to the answer to be sent to the client.
ReplyBodyLen ReplyBodyLen is the length in bytes for the answer.
UserData UserData is not used by the component nor the TAppServer component.