Remoting or raw socket

xiaoxiao2021-03-06  68

What kind of communication method is used between Peer? Is REMOTING or RAW Socket? Is the format use 2 credit or XML? If it is XML to be compressed? Do you need encryption? How do I check if the connection is disconnected?

Remoting vs. Raw Socket:

Cross-platform characteristics Remoting is not as good as Raw Socket;

Bandwidth efficiency Remoting is not as good as Raw Socket;

The communication protocol seamless upgrade and compatibility is similar;

Development difficult Remoting is difficult than Raw Socket (relative to me)

Developing workload Remoting is much smaller than Raw Socket

Dependence Remoting is greater than Raw Socket for .NET Framework;

2. 2 Enter vs. XML;

Bandwidth efficiency 2 is higher than XML;

The communication protocol seamless upgrade and compatibility is not as good as XML;

Development workload 2 is greater than XML (if you use Raw Socket)

Almost 2 dependence on .NET Framework

International support, 2, less than XML;

3. Do you need to be compressed;

Rear bandwidth efficiency after compression;

After the compression, the CPU processing load is increased;

4. Whether it is encrypted;

Increased security after encryption;

The bandwidth efficiency of encryption may be reduced;

After encryption, the CPU processing load is increased;

5. Timed check connection vs use lease mode;

Lease methods can be more efficient.

Tenrend methods are more difficult to develop, and CPU load may increase.

Today, it is found that if there is a thread inside the remote object, the lease will always be renewed, which will never release resources, so there should be a thread in the remote object. If the remote object really needs constantly doing some internal Operation, you can consider handing these responsibilities to some "service" that is running, releases its own resources in the "Function Object" in the remote object parser function.

Here, there is a problem with a process and thread view. If you want to completely control the priority of each part of the task, the resource (CPU) occupancy rate, you need to assign different processes or threads for different types of tasks, which is not only responsible Assigned to the object (the object knows the necessary information), and you need to assign tasks to threads (threads understand when to perform tasks), you can think that "service" is an object with independent process / thread, "service" in some In the case of a better component than the object.

These "service" interfaces are basically:

Void start ();

Void Stop ();

Pipe addnew ();

Void Remove (PIPE PIPE);

The interface of the PIPE is:

Void Enqueue (Object Request);

Object Dequeue ();

转载请注明原文地址:https://www.9cbs.com/read-110697.html

New Post(0)