IOS learning and ios learning routes

Source: Internet
Author: User

IOS learning and ios learning routes

Socket is an intermediate software abstraction layer for communications between the application layer and the TCP/IP protocol. It is a group of interfaces.   TCP: connection-oriented, reliable transmission (ensuring data correctness and Data Order), used to transmit a large amount of data (stream mode), slow speed, and costly connection establishment (time, system Resources ). UDP: for non-connection, unreliable transmission, for transmitting a small amount of data (packet mode), fast There are two common Socket types:1. stream Socket (SOCK_STREAM) connection-oriented Socket for connection-oriented TCP Service applications 2. datagram-type connectionless Socket, corresponding to connectionless UDP Service applications Socket call library functions mainly include: 1. create Socket (af, type, protocol) 2. establish the connection between the address and socket bind (socked, local addr, addrlen) 3. the server listens to the client request listen (Sockid, quenlen) 4. establish a connection between the server and client (for TCP connections). The client requests to Connect (socked, destaddr, addrlen. the server waits for receiving the Client Connection Request newsockid = accept (Socked, Clientaddr, paddrlen) 6 from the Socket numbered Sockid. send/receive data connection-oriented: send (socked, buff, bufflen) recv () 7. connection-free: sendto (socked, buff ,... , Addrlen) recvfrom () 8. Release socket close (sockid)

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.