In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what is the method of developing ServerSuperIO singleton communication mode". In daily operation, I believe that many people have doubts about the method of developing ServerSuperIO singleton communication mode. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "what is the method of developing ServerSuperIO singleton communication mode?" Next, please follow the editor to study!
8. Overview of singleton communication mode development and matters needing attention 8.1
The singleton communication mode is only applicable to network communication, and only one "device driver" can be added, where "device driver" is a logical concept that represents all devices or sensors. that is to say, all the data received are distributed to the "device driver".
8.2 description of communication mechanism
This control mode can only be used for network communication. There can be only one device driver in a service instance, which is equivalent to one device driver corresponding to N hardware device terminals. Data protocols that are more suitable for communication have fixed standards to handle different data with command keywords. It is suitable for highly concurrent hardware terminal devices to upload data actively, and the server processes and returns the corresponding data according to the data information.
The communication structure is shown below:
8.3 matters needing attention in device driver development
The device driver development of singleton mode is simpler. If the business is not complex, it only involves initialization parameters, real-time data, protocols, and data processing logic. More advanced applications will involve protocol data filtering (IReceiveFilter interface), data forwarding (IService interface), data view display (IGraphicsShow interface), etc., which will be introduced one by one in subsequent articles.
8.4 considerations for host program service instance configuration
Sta
1234567891011121314151617181920212223242526272829303132333435static void Main (string [] args) {/ / 55 AA 00 61 43 7A 00 43 B4 150D DeviceSingletonDriver dev1 = new DeviceSingletonDriver (); dev1.DeviceParameter.DeviceName = "Network equipment"; dev1.DeviceParameter.DeviceAddr = 0; dev1.DeviceParameter.DeviceID = "0"; dev1.DeviceDynamic.DeviceID = "0"; dev1.DeviceParameter.DeviceCode = "0"; dev1.DeviceParameter.NET.RemoteIP = "127.0.0.1"; dev1.DeviceParameter.NET.RemotePort = 9600; dev1.CommunicateType = CommunicateType.NET Dev1.Initialize ("0"); IServer server = new ServerManager (). CreateServer (new ServerConfig () {ServerName = "singleton service", NetReceiveBufferSize = 1024, ControlMode = ControlMode.Singleton, MaxConnects = 4000}); server.AddDeviceCompleted + = server_AddDeviceCompleted; server.DeleteDeviceCompleted + = server_DeleteDeviceCompleted; server.SocketConnected+=server_SocketConnected; server.SocketClosed+=server_SocketClosed; server.Start (); server.AddDevice (dev1); while ("exit" = = Console.ReadLine ()) {server.Stop ();}}
ControlMode = ControlMode.Singleton is set to unit mode.
8.5 Operation effect of singleton mode
After running 100 million concurrent connections on this machine, the jmeter,jmeter takes up about 1.4 gigabytes of memory and more than 90 percent of the CPU. I don't know why the laptop barely works because it consumes so much resources.
Now 15 clients are simulated to send data once every 100 milliseconds, and the effect is as follows:
Picture
At this point, the study on "what is the method of developing ServerSuperIO singleton communication mode" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.