Glossary

From Overbyte
Revision as of 23:55, 26 October 2017 by Mark- (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Main page -> Glossary

A

B

Blocking Mode

See non blocking mode.

C

Client

When speaking about sockets, a client is the program responsible for taking the initiative to connect to a remote system known as the Server.

D

Delimited Data

Sender and receiver must agree on how to transfer data. In a TCP session, imagine a sender sends two strings "Hello" and "LogMeIn" one after another. How to make sure that they will be received also one after another as two separate strings? Most likely they will be received by winsock as one string like "HelloLogMeIn", winsock then notifies the application about data has been received and is available. As you can see the receiver needs some more information. Either some delimiter is required in order to allow the receiver to split up data back into its original parts or the length of each part must be prefixed. The easiest way however is to use a delimiter. Many line-based internet protocols such as SMTP simply use CRLF for this purpose. Component TWSocket provides two properties to ease receipt of such delimited data. Properties LineMode and LineEnd. If you enable LineMode event OnDataAvailable will fire only in case of the delimiter specified in property LineEnd has been received. In order to read such delimited data from within OnDataAvailable event handler you may simply call method ReceiveStr, that's it. But note, the sender must append the delimiter to each string explicitly. To send delimited data you may use method SendStr, for instance SendStr('Hello' + #13#10).

Denial of Service (DoS)

A DoS is some form of attack against a network server. The aim is to render the server useless by overflowing the server with requests until all the server ressources are used.

DES

Data Encryption Standard. A symmetric-key algorithym for the encryption of data. Implemented in unit OverbyteIcsDES.pas. Superceded by more secure AES.

E

Event Driven

A program is said to be "event driven" when its program flow is controlled by events. An event is a code section, a component method, which is invoked when some condition occurs. For example, when data is received by a TWSocket, its OnDataAvailable event is triggered. Means that the code, assigned to the event by the programmer, is executed.

In an event driven program, the programmer does not wait for something to happen. The program does nothing (or something else usefull) until the event is triggered.

When using event driven components such as ICS, you seldom use sequential programming. You use a cascade of events. Let's take a simple example: Imagine our program must connect to a remote server, wait until the server sent his welcome message, then send a command and grab the result. In an event driven program, using an event driven component such as TWSocket, you call Connect and return. In OnDataAvailable you check for the welcome message. When received completely (easy with Line Mode) you send your command. In subsequent OnDataAvailable you read the command result.

F

G

H

Hash

A hash function is a non reversible mathematical function which creates a number (hash value) out of binary data of any size. It is often used to verify data integrity. Known hashes are e.g. SHA1 and MD5, both implemented in ICS as well.

I

ICMP

ICMP packets are used for several control functions.

IETF

Internet Engineering Task Force (IETF®) http://www.ietf.org/

J

K

Keep-Alive Packets (TCP)

A TCP keep-alive packet is a short packet which is transmitted periodically by the OS to keep the connection alive. The connection stays alive because those packets and their replies generate traffic (small) on the connection when the application is idle.

Keep-alives can be used to verify that the computer at the remote end of a connection is still available.

It is simply an ACK with the sequence number set to one less than the current sequence number for the connection. A host receiving one of these ACKs responds with an ACK for the current sequence number.

TCP keep-alives can be sent once every KeepAliveTime (defaults to 7,200,000 milliseconds or two hours) if no other data or higher-level keep-alives have been carried over the TCP connection. If there is no response to a keep-alive, it is repeated once every KeepAliveInterval seconds. KeepAliveInterval defaults to 1 second. Some (buggy) routers may not handle keep-alive packets properly.

L

Line Mode

Property LineMode specifies how TWSocket component shall trigger the OnDataAvailable event upon incomming data packets. If line mode is off (the default), TWSocket will trigger an OnDataAvailable event for each incomming data packet. If line mode is on (LineMode is set to TRUE), then TWSocket will buffer incomming data packets and search for an end-of-line marker specified by property LineEnd (defaults to CR/LF pair). If no end-of-line marker is found, the received packet is kept in the internal buffer and the OnDataAvailable event is not triggered. When the next data packet is received, another check is performed to find the first line end. If the line end is found, the component triggers the OnDataAvailable event. When the Receive method is called from the OnDataAvailable event, it will return data up to and including the first end-of-line marker. If a second end-of-line marker is received, another OnDataAvailable will be triggered immediately. The advantage of using LineMode is that component users need not worry about packet fragmentation since they see data comming in line by line.

M

Message Loop

See message pump.

Message Pump

The message pump is the small code section which removes messages from the message queue and process it. Speaking Delphi, the most common appearence of the message pump is Application.ProcessMessages. However there are many other forms of message pump. The message pump is sometimes named message loop.

Message Queue

Windows is an event driven operating system. To implement events, Windows use messages posted to a message queue. Each thread can have his own message queue but does not have one by default. The main thread of a GUI application always has a message queue. Messages are retrieved for processing from the message queue by the message pump.

N

Non-Blocking Mode

A component is said to work in non-blocking mode when it executes lengthy tasks in the background. Most ICS components provide this kind of non-blocking processing. For instance, when you call TWSocket.Connect, you get control back immediately while the connection occurs in the background, automatically. When the connection is established, the component triggers an OnSessionConnected event to inform you the operation requested has completed (success or failure). See also blocking mode.

O

P

POP3

Post Office Protocol 3 is a protocol used to fetch e-mail from a e-mail account.

Q

R

S

Server

When speaking about sockets, a server is the program passively listening for incomming client connections.

SMTP

Simple Mail Transfer Protocol. Defined by RFC 821, uses TCP port 25 by default, is an Internet standard for email transmission, extended by RFC 5321.

Socket

The socket word is used to designate a data structure and associated processing used by the operating system to handle TCP/IP operation.

Speaking ICS, a class TWSocket (and its derived classes) encapsulate the operating system data structure and processing. Data structures become properties while processing becomes methods and events.

T

TCP

Transmission Control Protocol. One of the protocol in the TCP/IP protocol suite. TCP is a reliable, stream oriented transport. TCP is responsible for verifying delivery from client to server. TCP is a point-to-point protocol requiring a connection to be established.

TCP/IP

Transmission Control Protocol/Internet Protocol. It is a family of protocols designed to allow computers to communicate with each other over any kind of network. The family name comes from two major protocols: IP which is responsible for moving packets of data between nodes and TCP which is responsible for verifying delivery from client to server. TCP/IP forms the basis of the Internet

Timeout

When an operation is not completed after a predefined period of time, it is said to be timed out. The timeout is the period of time after which, it is considered, the operation will never complete.

TTL

The Time To Live value is used to control how many hosts a packet may pass before it gets thrown away (if it hasn't yet reached its destination).

U

UDP

UDP is a low-overhead and connection-less protocol. It does not guarantee delivery of the packets (unlike TCP). On the other hand no connection must be established before sending and it allows for broadcasts and multicast transfers.

Usenet

Usenet is a network of Nntp servers which provide a public blackboard system consisting of individual usegroups.

Usegroup

Usegroup is a discussion group based on the Nntp protocoll. Groups exist in public and private forms and some groups are moderated groups where each post (article) will be reviewed by a moderator first. Newsgroups exist for nearly every topic one can imagine, for Delphi and C++ Builder exist some hosted by Embarcadero.

V

W

WinSock

Winsock (Windows Socket) is the name given by Microsoft for the operating system section which handles sockets. It is materialized by a number of DLL which implement an API. This API is encapsulated by the TWSocket class.

Actually, according to Winsock (Wikipedia), there're two main versions of Winsock implementations :

  • Version 1.1 of Winsock was supplied in an add-on package (called Wolverine) for Windows for Workgroups, and natively with Windows 95 and Windows NT 3.x.
  • Version 2.x of Winsock was supplied in an add-on package for Windows 95, and natively with Windows 98, Windows NT 4.0, and all subsequent Windows releases.

Microsoft did not supply implementations of Winsock 2 for Windows 3.x or Windows NT 3.x.

X

Y

Z