Talk C together (98th back: C language instance -- use message queue for inter-process communication 2)
Hello, everyone. In the previous session, we talked about the example of using message queue for inter-process communication.
Introduction
Microsoft recently launched a new platform for Generating integrated applications-Microsoft. NET Framework .. NET framework allows developers to use any programming language to quickly generate and deploy WebServices and applications. Microsoft Intermediate Language (MSIL) and real-time(JIT) compilers enable this language-independent framework.
A new Programming Language C # (read "C sharp") i
the client, the program design was followed. Until all requests of Client1 are responded, Client1 gets the value after adding one from its own response queue, and then Client2 does the same.
The following shows the windview demo result:
The first figure shows that T1 is the case where the supervisor creates three tasks and switches to the server. However, the server is blocked because the request queue is
certificate and install it. // It is best to set the connection mode to HTTPS, which is TCP by default. If it is TCP, put in the cloud Web application will error ServiceBusEnvironment.SystemConnectivity.Mode = Connectivitymode.https; // Start Connection Queueclient Client = queueclient.createfromconnectionstring (ConnStr, queuename);Get the message public messagedata GetMessage () {
Message Queue is Microsoft's message processing technology. It provides message processing and Message Queue functions for any application in any computer combination installed with Microsoft Windows, whether these computers are o
C #. Net simple application example of WINDOWS Message Queue
1. Install the message queue on the machine.
2. Start a program for listening to the Message Queue. The program keeps Retrie
actual methods) to manage resources and process messages.
Class is implemented again through the Start, Stop, Pause, and Continue methods.The input and error queue are referenced in the Start method. In the. NET Framework, messages are sent by the System.Messaging namespace processing:// Try to open the queue and set the default read/write attributeMessageQueue mqInput = new MessageQueue (sInputQueue );MqI
, you can grow with openness.
I admit that some places do not write well... Silly. I wrote multithreading for the first time. Not a lot of things. Just look at it.
With queues and multithreading, you can show multiple prompt boxes at the same time, but the number of prompt boxes displayed at the same time will not exceed the set value, if the value is exceeded, it will be displayed after the box is closed or automatically closed.
Let's take a look at it first and continue later:
This figure sh
Public class queuemanage
{
///
/// Send the object to the queue
///
/// Queue name, because the queue name should not be changed in an application, it is best to write it in the configuration file.
/// The object to be sent out
Public static void sendqueue (string queuepath, mybase. smsqueue sq)
{
System. messaging. messagequeue mqsend = new system. messaging. me
Both computers are operating systems that are Windows Server 2008Msmq+http support is installed on both computersThe firewalls of both computers are all shut downLocal ip:192.168.1.104Remote ip:192.168.1.142To establish a private queue remotely: TestCode to send the message locally:System.Messaging.MessageQueue MQ =New System.Messaging.MessageQueue ("Formatname:direct=http://192.168.1.142/msmq/private$/test
queueMsgtype Msgflg = ipc_nowait. If the queue does not have readable messages and does not wait, the enomsg error is returned.Msgflg = msg_noerror. The message is truncated when the message size exceeds msgsz.Msgtype> 0 and msgflg = msg_0000t. The receiving type is not equal to the first message of msgtype.
Ii.
Message Queue 1: Message QueueWhy Message Queue?
DecouplingIt is extremely difficult to predict the future needs of a project at the beginning of the project. An implicit data-based interface layer is inserted in the message
more efficient than std: list! This message queue is designed based on the original company's dual-Buffer Queue!
The test code is provided! And some interfaces!+ View Code
Interface:
classDuplexList{public:DuplexList(intsize = 1024);virtual~DuplexList(void);virtualintappend(CommonItem item);virtualintpeek(CommonItem item);protected:virtualintswap(Common
Linux Message Queue basics, linux Message QueueBasic concepts of Message Queue
Message Queue provides a method to send a piece of data from one process to another (limited to local)
Eac
Linux Message Queue practice (2) and linux Message Queue practiceMessage Queue Functions
#include
Msgctl Function
Function: gets/sets Message Queue information.
Prototype:
int ms
13. Why does app backend use Message Queue? 13. app backend Message QueueMany friends who have no practical project experience are unfamiliar with the message queue system. Message Queue
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.