Code changes the world

  • Posts – 107, Articles – 0, Comments – 1736
  • Cnblogs
  • Dashboard
  • Login
  • Home
  • Contact
  • Gallery
  • RSS

Wu Qin, Tyler

Linux Socket programming (no Linux)

By Wu Qin, 264619 Reading, 73 commentscollection.The editor

“Everything Socket!”

It’s a bit of an exaggeration, but the fact is that today’s network programming almost all uses sockets.

Experience with practical programming and open source project research.

We understand the value of information exchange, but how do processes communicate with each other in the network, for example, when we open the browser to browse the web every day, how does the browser process communicate with the Web server? When you chat with QQ, how does the QQ process communicate with the server or the QQ process where your friends are? All this has to do with sockets? What is a socket? What are the types of sockets? There are basic socket functions, which are introduced in this article. The main contents of this paper are as follows:

  • 1. How do processes communicate with each other on the network?
  • What is a Socket?
  • 3. Basic socket operations
    • 3.1 socket() function
    • 3.2. Bind ()
    • Listen (), connect() functions
    • 3.4. Accept () function
    • 3.5. Read (), write() functions, etc
    • 3.6. Close () function
  • 4, socket TCP three-way handshake to establish a connection in detail
  • 5, socket in the TCP quad handshake release connection details
  • 6. An example (practice)
  • 7, leave a question, welcome to reply!!

1. How do processes communicate with each other on the network?

There are many different ways of local interprocess communication (IPC), but they can be summarized in the following four categories:

  • Messaging (pipes, FIFO, message queues)
  • Synchronization (mutex, condition variable, read/write lock, file and write record lock, semaphore)
  • Shared memory (anonymous and named)
  • Remote procedure calls (Solaris door and Sun RPC)

But none of that is the subject of this article! What we’re talking about is how do processes in a network communicate with each other? The first problem to solve is how to uniquely identify a process, otherwise communication is impossible! A process can be uniquely identified locally by a process PID, but this is not possible on a network. In fact, the TCP/IP protocol family has helped us to solve this problem. The “IP address” of the network layer can uniquely identify the host in the network, and the “protocol + port” of the transport layer can uniquely identify the application program (process) in the host. In this way, a triplet (IP address, protocol, port) can be used to identify the process of the network, and the process communication in the network can use this flag to interact with other processes.

Applications using TCP/IP typically use application programming interfaces (APIS) : Sockets for UNIX BSD and TLI for UNIX System V (deprecated) to communicate between network processes. At present, almost all applications are using sockets, and now it is the network era, process communication is everywhere in the network, that is why I say “everything socket”.

What is a Socket?

We already know that processes on a network communicate through sockets. What is a socket? Socket originated from Unix, and one of the basic philosophies of Unix/Linux is that “everything is a file”, which can be operated in “open – > read/write/read – > Close” mode. Socket is a special file. Some Socket functions perform operations on it (read/write IO, open/close). These functions will be described later.

Origin of the word socket

The first use in networking was found in the document IETF RFC33, published on February 12, 1970, by Stephen Carr, Steve Crocker, and Vint Cerf. According to the Computer History Museum of America, Croker writes, “Elements of a namespace can all be called sockets. A socket interface forms one end of a connection, and a connection may be completely specified by a pair of socket interfaces. “This predates the BSD socket definition by about 12 years,” the Computer History Museum adds.

3. Basic socket operations

Since sockets are an implementation of the “open-write/read-close” pattern, sockets provide functional interfaces for these operations. The following uses TCP as an example to describe the basic socket interface functions.

3.1 socket() function

int socket(int domain, int type, int protocol);Copy the code

The socket function corresponds to the normal file opening operation. Normal file opening operations return a file descriptor, while socket() is used to create a socket descriptor that uniquely identifies a socket. The socket descriptor, like the file descriptor, is used for subsequent operations. It is used as a parameter to perform some read and write operations.

Just as you can pass different parameter values to fopen to open different files. When creating a socket, you can also specify different parameters to create different socket descriptors. The three parameters of the socket function are:

  • Domain: protocol domain, also known as protocol family. Common protocol families include AF_INET, AF_INET6, AF_LOCAL (or AF_UNIX, Unix domain socket), AF_ROUTE and so on. The protocol family determines the address type of the socket, and the corresponding address must be used in communication. For example, AF_INET determines the combination of ipv4 address (32-bit) and port number (16-bit), and AF_UNIX determines an absolute pathname as the address.
  • Type: indicates the socket type. Common socket types include SOCK_STREAM, SOCK_DGRAM, SOCK_RAW, SOCK_PACKET, SOCK_SEQPACKET, and so on. .
  • Protocol: indicates the specified protocol. Common protocols are IPPROTO_TCP, IPPTOTO_UDP, IPPROTO_SCTP, and IPPROTO_TIPC, which correspond to TCP transport protocol, UDP transport protocol, STCP transport protocol, and TIPC transport protocol (I will discuss this protocol separately!). .

Note: the combination of type and protocol is not optional. For example, SOCK_STREAM cannot be combined with IPPROTO_UDP. When protocol is 0, the system automatically selects the default protocol corresponding to type type.

When we call the socket to create a socket, we return the socket description word which exists in the address family (AF_XXX) space, but does not have a specific address. If you want to assign an address to it, you must call bind(), otherwise connect() and listen() will automatically assign a random port.

3.2. Bind ()

As mentioned above, bind() assigns a specific address in an address family to the socket. For example, AF_INET and AF_INET6 assign an ipv4 or ipv6 address and port number to the socket.

int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);Copy the code

The three parameters of the function are:

  • Sockfd: the socket description word, which is created using the socket() function and uniquely identifies a socket. The bind() function will give the description a name.
  • Addr: a const struct sockaddr * pointer to the protocol address to be bound to sockfd. The address structure varies according to the address protocol family used to create the socket. For example, ipv4 corresponds to:

    struct sockaddr_in {
        sa_family_t    sin_family; /* address family: AF_INET */
        in_port_t      sin_port;   /* port in network byte order */
        struct in_addr sin_addr;   /* internet address */
    };
    
    /* Internet address. */
    struct in_addr {
        uint32_t       s_addr;     /* address in network byte order */
    };Copy the code

    Ipv6 corresponds to:

    struct sockaddr_in6 { sa_family_t sin6_family; /* AF_INET6 */ in_port_t sin6_port; /* port number */ uint32_t sin6_flowinfo; /* IPv6 flow information */ struct in6_addr sin6_addr; /* IPv6 address */ uint32_t sin6_scope_id; /* Scope ID (new in 2.4) */; struct in6_addr { unsigned char s6_addr[16]; /* IPv6 address */ };Copy the code

    The Unix domain corresponds to:

    #define UNIX_PATH_MAX    108
    
    struct sockaddr_un { 
        sa_family_t sun_family;               /* AF_UNIX */ 
        char        sun_path[UNIX_PATH_MAX];  /* pathname */ 
    };Copy the code
  • Addrlen: Corresponds to the length of the address.

Usually when the server is started, it will bind a well-known address (such as IP address + port number) to provide services. Customers can connect to the server through it. The client does not need to specify, the system automatically assigns a port number and its OWN IP address combination. This is why it is common for the server to call bind() before LISTEN, while the client does not, but the system randomly generates one at connect().

Network and host byte order

Host endivots are what we call big-endian and little-endian modes: different cpus have different endivots. These endivots refer to the order in which integers are stored in memory. This is called host endivots. The standard definitions of big-endian and little-endian are as follows:

A) little-endian means that the low byte is stored at the low address end of memory and the high byte is stored at the high address end of memory.

B) Big-endian means that the highest byte is emitted at the lower address end of memory and the lowest byte is emitted at the higher address end of memory.

Network byte ordering: The 32-bit values of four bytes are transmitted in the following order: 0 to 7 bits, 8 to 15 bits, 16 to 23 bits, and 24 to 31 bits. This transfer order is called big-endian endienment. Since all binary integers in the TCP/IP header are required to be in this order when transmitted over the network, it is also called network byte order. Byte order, as the name implies, is the order in which data larger than one byte type is stored in memory. A byte of data has no order problem.

Therefore, before binding an address to a socket, first convert the host byte order to the network byte order. Do not assume that the host byte order uses big-endian like the network byte order. Because of this problem has caused a bloody case! There are a lot of puzzling problems in the company project code due to this problem, so please remember to make no assumptions about the host byte order, be sure to convert it to network byte order and then assign it to the socket.

Listen (), connect() functions

If a server calls socket() and bind(), it calls listen() to listen to the socket, and if the client calls connect() to make a connection request, the server receives the request.

int listen(int sockfd, int backlog);
int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);Copy the code

The first argument to listen is the socket description to listen on, and the second argument is the maximum number of connections that the socket can queue. The socket() function creates a socket of an active type by default. The Listen function changes the socket to a passive type, waiting for a connection request.

The first argument to connect is the client’s socket description, the second argument is the server’s socket address, and the third argument is the length of the socket address. The client establishes a connection to the TCP server by calling the connect function.

3.4. Accept () function

After the TCP server calls socket(), bind(), and listen(), it listens for the specified socket address. The TCP client sends a connection request to the TCP server after calling socket() and connect() in sequence. After the TCP server listens for the request, it calls the accept () function to accept the request and the connection is established. Then network I/O operations can begin, that is, read and write I/O operations similar to normal files.

int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);Copy the code

The first argument to accept is the socket description of the server, the second argument is a pointer to struct sockaddr *, which returns the protocol address of the client, and the third argument is the length of the protocol address. If ACCPET succeeds, the return value is a brand new descriptor automatically generated by the kernel to represent the TCP connection to the returning customer.

Note: The first argument to accept is the server’s socket descriptor, which is generated when the server starts calling the socket() function. The accept function returns the description of the connected socket. A server usually only creates a listening socket descriptor that lasts for the life of the server. The kernel creates a connected socket descriptor for each client connection accepted by the server process. When the server finishes serving a client, the corresponding connected socket descriptor is closed.

3.5. Read (), write() and other functions

Everything is all right, so far the server and the client have established a good connection. Network I/O can be called to read and write operations, that is, to achieve communication between different processes in the network role! Network I/O operations have the following groups:

  • read()/write()
  • recv()/send()
  • readv()/writev()
  • recvmsg()/sendmsg()
  • recvfrom()/sendto()

I recommend using the recvmsg()/sendmsg() functions, which are the most generic I/O functions and can actually be replaced with all the other functions above. Their declaration is as follows:

#include <unistd.h> ssize_t read(int fd, void *buf, size_t count); ssize_t write(int fd, const void *buf, size_t count); #include <sys/types.h> #include <sys/socket.h> ssize_t send(int sockfd, const void *buf, size_t len, int flags); ssize_t recv(int sockfd, void *buf, size_t len, int flags); ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen);  ssize_t recvfrom(int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen); ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags); ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags);Copy the code

The read function is responsible for reading from a FD. On success, read returns the actual number of bytes read, with a value of 0 indicating that the end of the file has been read and less than 0 indicating an error. If the error is EINTR, the read was interrupted, and if ECONNREST, the network connection is faulty.

The write function writes the nbytes in buf to the file descriptor fd. Returns the number of bytes written on success. Returns -1 on failure and sets the errno variable. In a network program, there are two possibilities when we write to a socket file descriptor. 1) If the return value of write is greater than 0, some or all data is written. 2) The value returned is less than 0. We have to deal with it according to the error type. If the error is EINTR, an interrupt error occurred while writing. If it is EPIPE, there is a problem with the network connection (the other party has closed the connection).

I will not introduce the other pairs of I/O functions, refer to the MAN documentation or Baidu, Google, the following example will use send/recv.

3.6. Close () function

After the connection between the server and the client is established, some read and write operations will be carried out. After the read and write operations are completed, the corresponding socket description word should be closed. For example, after the operation, the opened file should be closed by calling fclose.

#include <unistd.h>
int close(int fd);Copy the code

Close the default behavior of a TCP socket, marking the socket as closed, and immediately returning to the calling process. This descriptor can no longer be used by the calling process, that is, as the first argument to read or write.

Note: The close operation only causes the reference count of the corresponding socket description to be -1, and only when the reference count is 0 triggers the TCP client to send a termination request to the server.

4, socket TCP three-way handshake to establish a connection in detail

We know that TCP establishes a connection with a “three-way handshake,” where three packets are exchanged. The general process is as follows:

  • The client sends a SYN J to the server
  • The server responds with a SYN K and ACK J+1 for SYN J
  • The client then sends an acknowledgement ACK K+1 to the server

There are only three handshakes, but which of the socket’s functions does this three-way handshake occur? See the picture below:

Figure 1. TCP three-way handshake sent in the socket

As you can see from the figure, when the client calls CONNECT, the connection request is triggered and the SYN J packet is sent to the server. The server listens to the connection request, that is, receives the SYN J packet, calls the accept function to receive the request and sends the SYN K to the client, ACK J+1, then accept enters the blocked state. The client receives a SYN from the server, ACK J+1, and then connect returns with an acknowledgement of the SYN. When the server receives ACK K+1, accept is returned. Thus, the handshake for three times is completed and the connection is established.

Summary: Connect on the client side returns on the second handshake, while Accept on the server side returns on the third handshake.

5, socket in the TCP quad handshake release connection details

The above describes the TCP three-way handshake establishment process in the socket and the socket function involved. Now let’s look at the quad handshake release process in the socket.

Figure 2. TCP quad handshake sent in socket

The process is shown as follows:

  • An application process first calls close to close the connection, and TCP sends a FIN M.
  • After receiving the FIN M, the other end performs a passive shutdown to confirm the FIN. Its receipt is also passed to the application process as an end-of-file, because a FIN receipt means that the application process receives no additional data on the corresponding connection;
  • After some time, the application process that receives the end-of-file calls close to close its socket. This causes its TCP to also send a FIN N;
  • The source sender TCP that receives the FIN acknowledges it.

So there’s a FIN and an ACK in each direction.

6. An example (practice)

Having said that, let’s do it. Write a simple server, client (using TCP) – the server has been listening to the local port 6666, if received a connection request, will receive the request and receive the message sent by the client; The client establishes a connection with the server and sends a message.

Server-side code:


#include<stdio.h>

#include<stdlib.h>

#include<string.h>

#include<errno.h>

#include<sys/types.h>

#include<sys/socket.h>

#include<netinet/in.h>



#define MAXLINE 4096



int main(int argc, char** argv)

{

int listenfd, connfd;

struct sockaddr_in servaddr;

char buff[4096];

int n;



if( (listenfd = socket(AF_INET, SOCK_STREAM, 0)) == -1 ){

printf("create socket error: %s(errno: %d)\n",strerror(errno),errno);

exit(0);

}



memset(&servaddr, 0, sizeof(servaddr));

servaddr.sin_family = AF_INET;

servaddr.sin_addr.s_addr = htonl(INADDR_ANY);

servaddr.sin_port = htons(6666);



if( bind(listenfd, (struct sockaddr*)&servaddr, sizeof(servaddr)) == -1){

printf("bind socket error: %s(errno: %d)\n",strerror(errno),errno);

exit(0);

}



if( listen(listenfd, 10) == -1){

printf("listen socket error: %s(errno: %d)\n",strerror(errno),errno);

exit(0);

}



printf("======waiting for client's request======\n");

while(1){

if( (connfd = accept(listenfd, (struct sockaddr*)NULL, NULL)) == -1){

printf("accept socket error: %s(errno: %d)",strerror(errno),errno);

continue;

}

n = recv(connfd, buff, MAXLINE, 0);

buff[n] = '\0';

printf("recv msg from client: %s\n", buff);

close(connfd);

}



close(listenfd);

}Copy the code

Client code:


#include<stdio.h>

#include<stdlib.h>

#include<string.h>

#include<errno.h>

#include<sys/types.h>

#include<sys/socket.h>

#include<netinet/in.h>



#define MAXLINE 4096



int main(int argc, char** argv)

{

int sockfd, n;

char recvline[4096], sendline[4096];

struct sockaddr_in servaddr;



if( argc ! = 2) {

printf("usage: ./client <ipaddress>\n");

exit(0);

}



if( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0){

printf("create socket error: %s(errno: %d)\n", strerror(errno),errno);

exit(0);

}



memset(&servaddr, 0, sizeof(servaddr));

servaddr.sin_family = AF_INET;

servaddr.sin_port = htons(6666);

if( inet_pton(AF_INET, argv[1], &servaddr.sin_addr) <= 0){

printf("inet_pton error for %s\n",argv[1]);

exit(0);

}



if( connect(sockfd, (struct sockaddr*)&servaddr, sizeof(servaddr)) < 0){

printf("connect error: %s(errno: %d)\n",strerror(errno),errno);

exit(0);

}



printf("send msg to server: \n");

fgets(sendline, 4096, stdin);

if( send(sockfd, sendline, strlen(sendline), 0) < 0)

{

printf("send msg error: %s(errno: %d)\n", strerror(errno), errno);

exit(0);

}



close(sockfd);

exit(0);

}Copy the code

Of course, the above code is very simple, there are many shortcomings, this is just a simple demonstration of socket basic function use. In fact, no matter how complex the network program, use these basic functions. The above server is used in iterative mode, that is, only after processing a client request will go to the next client request, such server processing capacity is very weak, the real server need to have concurrent processing capacity! To require concurrent processing, the server needs to fork() a new process or thread to handle requests, etc.

7. Move

Leave a question, welcome to reply!! Are you familiar with network programming under Linux? If familiar with, write the following programs to complete the following functions:

Server side:

To Receive information about the Client whose IP address is 192.168.100.2, for example, Client Query, print Receive Query.

Client:

Send Client Query test, Cleint Query, and Client Query Quit to the server at 192.168.100.168 in sequence.

The IP address in the topic can be determined according to the actual situation.

This article covers simple socket programming.

The more complex ones need to go further.

(Unix Domain socket) ENOBUFS error occurs when udp messages >=128 KB are sent(a practical socket programming encountered problems, I hope to help you)

Author: Tyler Source: http://www.cnblogs.com/skynet/ based on attribution 2.5 China mainland license agreement release, reproduction, or used for commercial purposes, but you must keep a signed this article Tyler (include link).

  • C/C++ Internals,Unix/Linux programming


< Prev
1
Add your comment

  1. # 51 building u011603302  The 2014-07-01″

    socket base, mark Support (0)Against (0)

  2. # 52 floor sjtufighter  The 2014-07-28 10:43

    Thank you for sharingSupport (0)Against (0)

  3. # 53 building With the old  The purposes are 2014-10-09

    If (connect(sockfd, (struct sockaddr*)&servaddr, sizeof(servaddr)) < 0

    The code has only changed:

    char IPdotdec[20]; // Store a decimal IP address

    printf(“please input ip address”);

    scanf(“%s”,IPdotdec);

    Inet_pton (AF_INET,IPdotdec,&servaddr.sin_addr)<=0, this step is ok, it is run in Xcode5, always cannot connect to the serverSupport (0)Against (0)

  4. # 54 building With the old  In the 2014-10-09 s and the

    This sizeof(servaddr) is 16Support (0)Against (0)

  5. The # 55 floor zzf-bingo  The 2014-11-26 09:50

    Very good article! However, I did not find a separate description of the protocol field in the socket(). (By the way, in order to reply to you, I specially registered a blog garden account…)Support (0)Against (0)

  6. # 56 building jueying_8888  The 2015-01-28 08:50

    Good article, MarkSupport (0)Against (0)

  7. # 57 building Don’t hang out  The 2015-02-27 man

    If I want to restart the server, but the socket is not closed during the whole process, that is, I can still receive client requests, but only cache them, and continue processing after the server restarts successfully, what should I do?Support (0)Against (0)http://pic.cnblogs.com/face/u303875.gif?id=26210113

  8. # 58 building[I] Tyler  The ticket is 2015-02-27

    @Don’t hang out

    referenceIf I want to restart the server, but the socket is not closed during the whole process, that is, I can still receive client requests, but only cache them, and continue processing after the server restarts successfully, what should I do?

    For details, see “Nginx Smooth Restart and Upgrade”Support (0) Against (0)http://pic.cnblogs.com/face/u92071.jpg

  9. # 59 roger9567  The 2015-04-14 00:30

    nice! Support (0)Against (0)

  10. # 60 building Le to  The 2015-06-03 it

    It’s really good. In the past, “a few handshakes” was just a concept, this picture explains in detail!Support (0)Against (0)

  11. # 61 building Sawyer Ford  The 2015-06-09 material

    That’s a good explanationSupport (0)Against (0)http://pic.cnblogs.com/face/565026/20141119212220.png

  12. # 62 building myg  The 2015-06-21 beginning

    Building Lord:

    The server listens to the connection request, that is, receives the SYN J packet, calls the accept function to receive the request and sends the SYN K to the client, ACK J+1, then accept enters the blocked state. There is something wrong with this sentence!!

    The server sends SYN ACK packets to the client without calling accept.Support (0)Against (0)

  13. # 63 building There is no one but the hand  The 2015-07-23 persons

    Thank you first, I think I have to see it again.Support (0)Against (0)

  14. # 64 building The years heights  The 2015-11-17 11:07

    ACK J+1: The server sent an ACK J+1: SYN K: ACK J+1: the server sent an ACK J+1: SYN K: ACK J+1: There is no need to call accept. The accept function is only used to fetch an existing TCP connection from the TCP queue.Support (0) Against (0)

  15. # 65 building Wu 2  The 2015-12-28 10:40:

    Good articleSupport (0)Against (0)http://pic.cnblogs.com/face/828194/20151027113020.png

  16. # 66 building Tomasmule  The 2016-04-19 11:58

    Just opened the blog park, already fansSupport (0)Against (0)

  17. # 67 building Program ape – Stop less  The 2017-04-17 14:03

    Praise theSupport (0)Against (0)http://pic.cnblogs.com/face/781239/20170930105542.png

  18. # 68 building The fearless have no fear  The 2017-06-19 11:51

    That’s a good oneSupport (0)Against (0)http://pic.cnblogs.com/face/726451/20150302175807.png

  19. # 69 building Apprentice_saber  The 2017-07-24 used

    Thank you for your help. Like it!!Support (0)Against (0)

  20. # 70 building Run, tutu  The 2017-09-11 18:04

    That was wonderful. Thank you.Support (0)Against (0)http://pic.cnblogs.com/face/990360/20170523180602.png

  21. # 71 building KRCheung  The 2017-12-05 21:57

    Rare building Lord has the heart to arrange! Thank you!Support (0)Against (0)http://pic.cnblogs.com/face/1066524/20170227130418.png

  22. # 72 building Sit still  The 2017-12-06 joyfully

    It’s really awesome. Markmark..Support (0)Against (0)

  23. # 73 building38616902017/12/9 13:54:10 Rain falls sad ~  In the 2017-12-09 s when

    Very goodSupport (0)Against (0)http://pic.cnblogs.com/face/856389/20171120165836.png

< Prev
1

Refresh the comments
Refresh the page
Return to the top
The login
registered
access
More than 500,000 VC++ source: large industrial control, configuration, simulation, modeling CAD source code 2018!



【 Recommended 】 How to buy Tencent cloud server more cost-effective?




Latest IT News



To letv net huge loss of a loss of 300 gem company profits



Popular friends circle of crowdfunding homestay, why I do not care about it?



Facebook user Growth Slowing Executive: It’s just temporary



If the iPhone X is killed, who is it?



How much of the middle class has fallen into the “middle-income trap”?



More news…

Latest Knowledge Base articles



Practice of domain driven design in Internet business development



Step into the cloud



Threads and processes from an operating system perspective



The path to software testing transformation



Look inside and outside the door



More knowledge base articles…

About

Tyler



Eight years and three months



Recommend the blog



3504



18
+ add attention

The latest essays

  • Unity3D mobile game development practice
  • Introduction of Unity3D shader
  • PyQt5 application and practice
  • Nginx + CGI/FastCGI + C/Cpp
  • Nginx installation and use
  • Software management using Python gracefully
  • Environment management using Python gracefully
  • SpriteSheet animation engine
  • AS3 makes use of CPU cache
  • On the Road to Web Game Development (11)
  • Custom path to create cocos2D-x project
  • C++ static and dynamic libraries
  • C++ object model
  • Python applications and practices
  • PureMVC (AS3) Analysis: Design Patterns (2)

The latest comments

  • Re:C++ static and dynamic libraries

    @viola hello, did you have a compilation error when you referred to the third party library, I now have cannot open fiel ‘C:\Users\Administrator\Documents\Visual. Obj, — Shun_Voice
  • Re:C++ static and dynamic libraries

    Cannot open fiel ‘C:\Users\Administrator\Documents\Visual. Obj, — Shun_Voice
  • Re:C++ static and dynamic libraries

    Read the best articles in 2017!! Great ~! ~~~ — Pineapple 007
  • Re:Linux Socket programming (unlimited Linux)

    Very good — sad rain
  • Re:Linux Socket programming (unlimited Linux)

    It’s really awesome. Markmark.. — Keep writing

Archives of essays

  • April 2016 (1)
  • August 2015 (1)
  • January 2015 (1)
  • December 2014 (3)
  • November 2014 (1)
  • February 2014 (3)
  • November 2013 (1)
  • October 2013 (1)
  • September 2013 (1)
  • May 2013 (1)
  • March 2013 (2)
  • February 2013 (2)
  • January 2013 (2)
  • December 2012 (4)
  • November 2012 (1)
  • August 2012 (1)
  • April 2012 (1)
  • March 2012 (2)
  • January 2012 (1)
  • July 2011 (1)
  • June 2011 (5)
  • May 2011 (3)
  • March 2011 (2)
  • February 2011 (1)
  • January 2011 (2)
  • December 2010 (6)
  • October 2010 (1)
  • September 2010 (4)
  • July 2010 (12)
  • June 2010 (4)
  • May 2010 (14)
  • April 2010 (12)
  • March 2010 (10)

The calendar

< In December 2010 >
day one two three four five six
28 29 30 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 1
2 3 4 5 6 7 8

Classification of essays

  • .NET 2.0 Configuration Puzzle Series (9)
  • .NET(C#) Internals (10)
  • (3)
  • 【 reproduced 】(2)
  • Android Development Journey (18)
  • as3(1)
  • C/C++ Internals(15)
  • cocos2d-x(1)
  • JavaScript(1)
  • nginx(2)
  • PureMVC (AS3) Analysis (5)
  • Python(5)
  • Unity3D(2)
  • Programming under Unix/Linux (8)
  • Server Development (3)
  • Application Development based on AIR Android (1)
  • Client Development (1)
  • Database (4)
  • Web Game Development (23)
  • Source code analysis: DotText source code learning (2)
  • Source code analysis: Mongoose(5)

Recommended leaderboard

  • 1. Character set and Encoding (Charset & Encoding) (170)
  • 2. HTTP protocol and its differences between POST and GET & how to use POST and GET in C#
  • 3. Android Development Journey: Environment Building and HelloWorld(138)
  • 4. Linux Socket programming (no Linux) (129)
  • 5. Browser caching mechanism (87)
  • 6. Development Practice of Unity3D Mobile Games (83)
  • 7. C++ static and dynamic libraries (75)
  • 8. HTTP keep-alive mode (60)
  • 9. Multithreaded Programming for Linux (No Linux) (58)
  • Extern “C” {}(51)

Reading leaderboards

  • 1. Android development journey: Environment building and HelloWorld(1065239)
  • 2. Nginx Installation and Use (266235)
  • 3. Linux Socket programming (no Linux) (264619)
  • 4. Character set and Encoding (Charset & Encoding) (226355)
  • Find, grep(125537)
  • 6. C++ function overloading (114479)
  • 7. Android Development Journey: The Android Architecture (106403)
  • 8. Android Development Journey: Several Layout methods and Practice of View (100615)
  • 9. C++ static and dynamic libraries (99245)
  • 10. C/C++ memory Leaks and Detection (93857)

Series of index posts

  • .NET 2.0 Configuration Puzzle Series Index (finished)

www.spiga.com.mx

Copyright © 2018 Tyler

Blog garden