Delphi socket programming

Source: Internet
Author: User

It was not the first time I came into contact with socket programming, but I used to look at other people's pictures and don't know the specific principles.

A new project has a new start and requires a new understanding.

Delphi has two sets of TCP Socket components:

Indy Socket component (IdTCPClient and IdTCPServer) and Delphi native TCP Socket component (ClientSocket and ServerSocket ),

They are blocking and non-blocking methods;

There is also an open-source non-blocking Component ICS (Internet Component Suite)

[Users said: Indy can be used for non-large projects, and Indy can support IOCP + WSAPI connections of about 1000 network connections, which is not a problem]

After Delphi7, the TCP Socket component is invisible to the Panel. Instead of being discarded, the TCP Socket component is hidden.

[I guess the reason is that non-blocking occurs because Unix supports fork. Both the client program and server can fork new processes and start these processes, thus, blocking Socket can be easily used. Windows
3. x neither supports fork nor multithreading. When a blocking Socket is used, the user interface is "locked" and cannot respond to user input.

In the era of Delphi7, Windows has been greatly improved, and the multi-thread support has been very good. The non-blocking method is much more difficult than the blocking method. Of course, the specific selection should be determined based on the actual project requirements .]

Activation Method:

 
Select Install Packages under Component
Add it to/Bin/dclsockets * 0. bpl .;

XE series, which can only be seen in VCL Form after installation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.