Difference between revisions of "TWSocket"
Jump to navigation
Jump to search
Line 112: | Line 112: | ||
{| | {| | ||
− | | width="140" valign="top" | [[TWSocket.Abort | Abort]] |||| | + | | width="140" valign="top" | [[TWSocket.Abort | Abort]] |||| Close the socket, see also [[Closing a socket]]. |
|- | |- | ||
| valign="top" | [[TWSocket.Accept | Accept]] |||| | | valign="top" | [[TWSocket.Accept | Accept]] |||| | ||
Line 118: | Line 118: | ||
| valign="top" | [[TWSocket.CancelDnsLookup | CancelDnsLookup]] |||| | | valign="top" | [[TWSocket.CancelDnsLookup | CancelDnsLookup]] |||| | ||
|- | |- | ||
− | | valign="top" | [[TWSocket.Close | Close]] |||| | + | | valign="top" | [[TWSocket.Close | Close]] |||| Close the socket gracefull, see also [[Closing a socket]]. |
|- | |- | ||
− | | valign="top" | [[TWSocket.CloseDelayed | CloseDelayed]] |||| | + | | valign="top" | [[TWSocket.CloseDelayed | CloseDelayed]] |||| Close the socket gracefull in a message handler, see also [[Closing a socket]]. |
|- | |- | ||
− | | valign="top" | [[TWSocket.Connect | Connect]] |||| | + | | valign="top" | [[TWSocket.Connect | Connect]] |||| Connect to a remote host. |
|- | |- | ||
| valign="top" | [[TWSocket.Create | Create]] |||| | | valign="top" | [[TWSocket.Create | Create]] |||| | ||
Line 130: | Line 130: | ||
| valign="top" | [[TWSocket.Destroy | Destroy]] |||| | | valign="top" | [[TWSocket.Destroy | Destroy]] |||| | ||
|- | |- | ||
− | | valign="top" | [[TWSocket.DnsLookup | DnsLookup]] |||| | + | | valign="top" | [[TWSocket.DnsLookup | DnsLookup]] |||| Perform a DNS lookup of a hostname in background. See also [[OnDNSLookupDone]]. |
|- | |- | ||
| valign="top" | [[TWSocket.Dup | Dup]] |||| | | valign="top" | [[TWSocket.Dup | Dup]] |||| |
Revision as of 16:36, 25 February 2006
Main page -> ICS component reference -> TWSocket
Contents
Overview
- unit WSocket.pas
- inheritance
TWSocket component is implementing the TCP protocol described in RFC 793 and and UDP protocol described in RFC 768. Both protocols are encaptulated by the IP protocol described in RFC 791. TWSocket is used in almost every other ICS component.
TWSocket component can be used as client or a server. For its use as TCP server however TWSocketServer is encouraged because of his advanced features.
Properties
Addr | Client: The host to connect to. Server: The interface to listen on. | |
AllSent | ||
BufSize | Size in bytes for send dynamic buffer cell. | |
ComponentOptions | ||
DnsResult | Typically called in OnDnsLookupDone. The IP address of the remote host given as argument to DnsLookup. | |
DnsResultList | Similar to DnsResult but a TStringList containing the multiple IP's of the host if appropriate. | |
FlushTimeout | ||
Handle | Handle for the underlaying hidden window. | |
HSocket | Winsock handle for underlaying socket. | |
IcsLogger | ||
LastError | ||
LineEcho | Echo all received characters back to tramitter. | |
LineEdit | Handle received control characters used for editing. | |
LineEnd | End of line character(s) used ot trigger OnDataAvailable. | |
LineLength | ||
LineLimit | Maximum line lenght to receive before triggering OnLineLimitExceeded. See also DOS attac. | |
LineMode | Use LineEnd as end of line marker to trigger OnDataAvailable. | |
LingerOnOff | ||
LingerTimeout | ||
ListenBacklog | ||
LocalAddr | The local address where the socket is bound to. | |
LocalPort | The local port where the socket is bound to. | |
MultiCast | ||
MultiCastAddrStr | ||
MultiCastIpTTL | ||
MultiThreaded | Set when TWSocket has to use his own message pump. | |
PeerAddr | The remote address where the socket is bound to. | |
PeerPort | The remote port port where the socket is bound to. | |
Port | Client: The port to connect to. Server: The port to listen on. | |
PortNum | Integer value of Port. | |
Proto | The protocol to use, can be tcp or tcp. | |
RcvdCnt | ||
RcvdCount | ||
RcvdPtr | ||
ReadCount | ||
ReqVerLow | ||
ReqVerHigh | ||
ReuseAddr | ||
SendFlags | ||
SocksAuthentication | ||
SocksLevel | ||
SocksPassword | ||
SocksPort | ||
SocksServer | ||
SocksUsercode | ||
State | Current state of the socket, mainly used for log or display purposes. | |
Terminated | ||
Text |
Methods
Abort | Close the socket, see also Closing a socket. | |
Accept | ||
CancelDnsLookup | ||
Close | Close the socket gracefull, see also Closing a socket. | |
CloseDelayed | Close the socket gracefull in a message handler, see also Closing a socket. | |
Connect | Connect to a remote host. | |
Create | ||
DeleteBufferedData | ||
Destroy | ||
DnsLookup | Perform a DNS lookup of a hostname in background. See also OnDNSLookupDone. | |
Dup | ||
Flush | ||
GetPeerAddr | ||
GetPeerName | ||
GetPeerPort | ||
GetSockName | ||
GetXAddr | ||
GetXPort | ||
Listen | ||
MessageLoop | ||
MessagePump | ||
Pause | ||
PeekData | ||
ProcessMessage | ||
ProcessMessages | ||
PutDataInSendBuffer | ||
PutStringInSendBuffer | ||
Receive | ||
ReceiveFrom | ||
ReceiveStr | ||
Release | ||
Resume | ||
ReverseDnsLookup | ||
Send | ||
SendStr | ||
SendTo | ||
SetLingerOption | ||
Shutdown | ||
TimerClear | ||
TimerCmp | ||
TimerIsSet | ||
ThreadAttach | ||
ThreadDetach | ||
WaitForClose | Align test |
Events
OnBgException | Background exception occured. | |
OnChangeState | State of TWSocket has changed. | |
OnDataAvailable | Data available in internal receive buffer. | |
OnDataSent | Internal sent buffer is completely delivered to winsock. | |
OnDebugDisplay | ||
OnDnsLookupDone | DNSLookUp has finished. | |
OnError | Discouraged, use exception handling instead. | |
OnLineLimitExceeded | Denial of service attack | |
OnMessagePump | To call your own message pump. | |
OnSendData | Winsock send buffer is empty, will be filled again by internal send buffer if still data available to send. | |
OnSessionAvailable | Client connected to this server. | |
OnSessionClosed | Socket has closed. | |
OnSessionConnected | Session to host etablished. | |
OnSocksAuthState | ||
OnSocksConnected | ||
OnSocksError |
How to