Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006


TCP communication, the rich diversity program design

TCP communication, the rich diversity program design



Design of the fourth year under the TCP communications paradigm can quickly prepare a communication process
Sequence, whereby some people might think TCP programming is very simple. In fact, this is not true.
TCP programming is relatively rich in content. Mainly reflected in the richness of its programming
Means of communication and message on the diversity of format.


1. Communication

Mainly in the following three categories :

(1) SERVER/CLIENT way

1. Client Server side of a connecting one side, or so-called point-to-point (peer to peer) :
2. Client Server side connecting more than one side, which is usually the way with the server.
3. Client side of a multi-server side, this method is rare, mainly
Client server to send requests for a number of circumstances.


(B) connections

1. Long link

Client-side and server side first establish communication links connecting the building after being opened.
Then for sending and receiving messages. Has been under way since communication links
There, it can create links with the following orders : check

Netstat-f inet|grep port (like 5678).

Such methods are commonly used in point-to-point communications.


2. Short slip

Client side and Server Message transceiver once every transaction even when communication
Then, immediately after the transaction has continued to connect. Such methods are commonly used in a point-to-multipoint
Communications, such as linking a number of Client Server.


(C) transmission reception mode

1. Asynchronous

Send and receive messages in separate, independent of each other, separating. This side
- Also divided in two scenarios :

(1) : duplex asynchronous receive and send the same procedure, there are two different
Son were responsible for sending and receiving process
(2) : asynchronous receive and send single-use two different procedures to be completed.

2. Synchronous

Simultaneously sending and receiving messages is not only waiting to receive messages sent after the return message.
Synchronous normally considered overtime, that is not unlimited message issued after such upswing
You need to set overtime hours over the time reported back to the sender instead of waiting time
The text directly to the return of overtime.


Effective means of communication is the combination of these three forms of communication. For example, the general book
TCP procedures are examples of short-synchronous link SERVER/CLIENT procedures. Some
The basic composition is not more popular is the combination of the following categories : value

Synchronous short slip Server/Client
Synchronous link Server/Client
Asynchronous short slip Server/Client
Double connect asynchronous long Server/Client
Asynchronous long connecting single-Server/Client

Duplex asynchronous link which is the most complex long a means of communication, sometimes by
Often arise between the different cities in different banks or communications between the two systems.
For example, Golden Card Project. As these types of communications relatively fixed, so it can be pre -
The first compilation of this template several means of communication procedures.


2. Message format

Korrespondenz more diversity text format, corresponding to read and write messages on the need to design the corresponding Access
Admission and send messages function.

(1) obstruction and nonblocking mode

1. Nonblocking mode

Reading time for action continued to function, if not to receive messages and wait for a period of time
Return to overtime, which generally require overtime designated time.

2. Obstructive way

If there are no messages received, read function has been in a state of waiting until messages arrive.



(B) read and write cycle mode


1. Message to directly read and write

In a one-time action to receive or send messages to all read or were not all
Message sent bytes.

2. Read and write cycle length is not specified

This generally occurs at short slip process, by routing constraints of a longer report
The text might be in the process of transmission network into several packets decomposition. Reading may not be a
Finished all of a newspaper article, which requires recycling newspapers text until completion date.

3. Message length with the first cycle of literacy

This is normally done in a long process of connecting, as in no longer linked to conditions
Judge read and write cycle come to an end, it is necessary to increase the length of the first message. Reading Function
First, read the first newspaper article on the length, the length according to the newspaper article. The actual situation,
Bao code format often not the same, if the non-ASCII messages first, it is also necessary
ASCII conversion, the first code system, a common message :
(1) n bytes of ASCII
(2) n bytes of BCD
(3) network integer n bytes of code



These are some typical read and write messages, template together with the means of communication
Typical API function to provide some pre-reading and writing. Of course, in practical problems, they may also
Message format must be coordinated with each other to prepare the API reading and writing.

In reality, we often need to link the system with other systems.
With these templates with the API can be said that the communications procedures are not in any way connected problems.


BLOG LIOU
2002.11.8

TCP communication, the rich diversity program design

For the good, as a portal to the manual.

I will give you a home precision.

TCP communication, the rich diversity program design

If you have the time you can continue to add articles.

Thank you.

TCP communication, the rich diversity program design

Summary : lol : Yes, it was very clear :)

TCP communication, the rich diversity program design

Halo

TCP communication, the rich diversity program design

Bamboo, the Supreme you also continue to sum up! : Oops :

TCP communication, the rich diversity program design

This message has been home to the best in software technology. Ha ha

TCP communication, the rich diversity program design

Can you share some of you mentioned the template defines procedures? Perhaps this is the information



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com