Objective-c Related knowledge points

Source: Internet
Author: User

Thread synchronization is implemented in 1,objective-c:

Mutexlock (mutex), Nscondition Lock (conditional lock) Message delivery

2,UDP and TCP:

TCP: Transmission Control Protocol, which provides connection-oriented, reliable, point-to-point communication.

UDP: User Packet protocol. Providing non-connected unreliable point-to-multipoint communication is a connectionless transport-layer protocol in the OSI Reference model that provides simple, unreliable information transfer for transactions.

3,TCP/IP the process of establishing a connection:

In the TCP/IP protocol, the TCP protocol provides a reliable connection service, using three-time handshake to establish the connection;

First handshake: When the connection is established, the client sends a connection request to the server and enters the Syn_send state, waiting for the server to confirm;

Second handshake: The server receives a client connection request and sends an allow connection reply to the client, at which point the server enters the SYN_RECV state;

Third handshake: The client receives the server's allow connection reply, sends the acknowledgement to the server, the client and the server enter the communication state, and completes three handshake.

(The so-called three-time handshake, is to have three times the connection information of the sending, receiving process.) The establishment of TCP connections requires the sending and receiving of three connection information. )

4, a global variable can be defined in a header file that is contained by multiple. c files, declaring a global variable with the same name in static form in a different C file. The precondition is that only one of the C files can have the initial value assigned to this variable, and the connection will not be faulted at this time.

5, referencing a global variable that has already been defined:

    • extern keyword
    • You can also use the method of referencing the header file.

If you refer to a header file by reference to a global variable in the header file, assuming that your variable is wrong, then the compilation will be error, if you use the Extern method, if you make the same error, you will not error during compilation, and error during the connection.

Objective-c Related knowledge points

Related Article

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.