Http://blog.chinaunix.net/uid-20364597-id-3794822.html
For example, we run Android on the hardware, but we need another program to handle some things (this program also runs on the same machine ). To put it simply, two independent processes
For socket, I don't want to know its history here. I just want to say that it is a process communication method at the time, in short, some API functions of the network library can be called to exchange data between processes distributed across
1 */This article provides an example of socket-related functions in the PHP tutorial. If you create a socket, you will receive a socket connection and write it into a socket to initialize the connection. */2 $ IP = "127.0.0.1"; // define IP address 3
Server:
# Define recv_posted 0# Define send_posted 1
Char buffer [1024];
Typedef struct _ per_handle_data{Socket socket; // This structure is used to send a socket to the port} Per_handle_data, * lper_handle_data;
Typedef struct _
About socket judgment disconnection and reconnection The following is a thread function uint cmonitordlg: threadfunction (lpvoid pparam) {wsadata; socket s; // create socket int Port = port; int ilen; // The length of the data received from the
Communication
Server:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
# Pragma
Comment (Lib, "ws2_32.lib ")
# Include
Winsock2.h
>
# Include
Stdio. h
>
Void
For many beginners, network communication
Program Development, a common phenomenon is that it is difficult to start. Many concepts such as sync, async, block, and unblock are confusing for beginners, I only know it, so I don't know why.
The
First, let's take a look.
Program
Code :
/* Server. C */# Include # Include /* for socket */# Include /* for clock ();*/
# Define listen_port 5500/* listening port */
# Pragma comment (Lib, "ws2_32.lib")/* import library for socket */
ArticleDirectory
I. Winsock Initialization
Ii. IPv4 struct
3. Create a socket
Iv. Functions and steps to be called by the server
5. Functions and steps to be called by the client
I. Winsock Initialization
Each
This chapter describes several mechanisms for user space programs to communicate with the kernel or read kernel information.
1) procfs (/proc)Both procfs and sysctl can export internal kernel information, but procfs is used to export read-only data,
/** Tcpserver. c*/# Include # Include # Include # Include # Include # Include # Include # Include # Define servport 1888# Define max_connected_no 10# Define maxdatasize 5# Define backlog 10Int main (){Struct sockaddr_in server_sockaddr,
// Portscan. cpp: defines the entry point for the console application.//
/// =================================================== ==========================================================/// Portscan-Port Scanner////// 2005-7-8 16:49:52/// ==========
Socket Communication Process
Define variable -- get Winsock version -- load Winsock database -- initialize -- create socket -- set socket options -- close socket -- uninstall Winsock database -- release all resources The entire program
In Windows, interfaces can communicate in two ways: Blocking Mode and non-blocking mode. When performing I/O operations on a set of interfaces working in blocking mode, the function must wait until relevant operations are completed.
(Or you can use
For many beginners, a common phenomenon in the development of network communication programs is that it is difficult to start. Many concepts such as sync, async, block, and unblock are confusing for beginners, I only know it, so I don't know why.The
Document directory
Delphi advanced network programming
Delphi advanced network programming
DelphiTutorial Series of books(051)《DelphiAdvanced Network Programming Organize netizens (state)Email:Shuaihj@163.com
:
Source code of the PDF attachment
Basic Python socket programming
Basic Python socket programming
This article describes the basic Python socket programming tutorials, including the basic sending and receiving information. For more information, see
This article describes how to use
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.