Click here to Skip to main content
15,902,938 members
Home / Discussions / C#
   

C#

 
QuestionHelp Pin
levan omadze4-Jan-10 20:58
levan omadze4-Jan-10 20:58 
AnswerRe: Help Pin
0x3c04-Jan-10 21:11
0x3c04-Jan-10 21:11 
GeneralRe: Help Pin
levan omadze4-Jan-10 21:43
levan omadze4-Jan-10 21:43 
GeneralRe: Help Pin
0x3c05-Jan-10 5:58
0x3c05-Jan-10 5:58 
AnswerRe: Help Pin
Game-point4-Jan-10 21:58
Game-point4-Jan-10 21:58 
QuestionA network-related or instance-specific error occurred while establishing a connection to SQL Server Pin
Tridip Bhattacharjee4-Jan-10 20:34
professionalTridip Bhattacharjee4-Jan-10 20:34 
AnswerRe: A network-related or instance-specific error occurred while establishing a connection to SQL Server Pin
Jimmanuel5-Jan-10 8:32
Jimmanuel5-Jan-10 8:32 
QuestionMSMQ Receiving messages Help!!! Pin
faheemnadeem4-Jan-10 19:32
faheemnadeem4-Jan-10 19:32 
Hi,
I have recently faced a problem, which i am unable to solve. Anyone can guide me please.

Scenario:
I am using MSMQ to communicate between many programs running concurrently...

Programs:
Dedicated TCP/IP server - Windows service
Dedicated Serial Server - Windows service
Dedicated listening Data Processor server - Windows service
Server Manager - Winform App

Message queues:
Data Queue
Command Queue
Admin Queue

I have two communication server listening and sending data to remote clients and data processor. Raw and Processed data are communicated through messages from servers to winform app through data processor. There are two classes named (Event receiver, Event reporter), which each running program subscribes too to communicate between each other. The reporting side is simple containing commands only to send messages. The problem lies in the design of event receiver class.

Its a single classes initializing three receiving(not peeking) events on three message queues. Whereby then it distributes received messages, by using many custom events.

Problem.
Currently declared events as static as they are too be used by many programs running in different projects (i.e the server service project , server manager winform project). The Event reporter, and receiver are in a class library.
What i want is a design pattern for the event receiver class. Which houses MSMQ object initialization and events generated by receiving messages on queue asynchronously, + custom delegates/ events for reporting these messages to different programs in different projects(who subscribe to the static event in this class).
Currently i initialized the Class in the main method of service project, every thing works perfectly there. But nothing happens if i initialize the same class in winform project, which is also dumb work from me as receiving event for message queues now occurs twice in memory as there are now two objects for the class. i.e. May be message is already taken by one class from the queue.

Finally i want a solution in the same design pattern whereby all programs running in different projects are able to to subscribe to same event receiver classes housing receiving events on MSMQ's and custom events , may be static or not?

Help pleasee
i am really stuck!!!!
AnswerRe: MSMQ Receiving messages Help!!! Pin
Jimmanuel5-Jan-10 8:52
Jimmanuel5-Jan-10 8:52 
GeneralRe: MSMQ Receiving messages Help!!! Pin
faheemnadeem5-Jan-10 17:57
faheemnadeem5-Jan-10 17:57 
AnswerRe: MSMQ Receiving messages Help!!! Pin
Jimmanuel6-Jan-10 1:09
Jimmanuel6-Jan-10 1:09 
GeneralRe: MSMQ Receiving messages Help!!! Pin
faheemnadeem6-Jan-10 4:05
faheemnadeem6-Jan-10 4:05 
GeneralRe: MSMQ Receiving messages Help!!! Pin
Jimmanuel6-Jan-10 4:52
Jimmanuel6-Jan-10 4:52 
GeneralRe: MSMQ Receiving messages Help!!! Pin
faheemnadeem6-Jan-10 5:58
faheemnadeem6-Jan-10 5:58 
GeneralRe: MSMQ Receiving messages Help!!! Pin
Jimmanuel6-Jan-10 6:57
Jimmanuel6-Jan-10 6:57 
QuestionRead data from a SerialPort: cross-thread not true Pin
AlexB474-Jan-10 18:29
AlexB474-Jan-10 18:29 
AnswerMessage Closed Pin
4-Jan-10 21:50
stancrm4-Jan-10 21:50 
GeneralRe: Read data from a SerialPort: cross-thread not true Pin
AlexB475-Jan-10 1:46
AlexB475-Jan-10 1:46 
AnswerRe: Read data from a SerialPort: cross-thread not true Pin
Luc Pattyn5-Jan-10 2:36
sitebuilderLuc Pattyn5-Jan-10 2:36 
GeneralRe: Read data from a SerialPort: cross-thread not true Pin
AlexB475-Jan-10 3:44
AlexB475-Jan-10 3:44 
GeneralRe: Read data from a SerialPort: cross-thread not true Pin
Luc Pattyn5-Jan-10 3:52
sitebuilderLuc Pattyn5-Jan-10 3:52 
Questionminimizing and maximizing Pin
ummu 24-Jan-10 18:13
ummu 24-Jan-10 18:13 
AnswerMessage Closed Pin
4-Jan-10 21:48
stancrm4-Jan-10 21:48 
GeneralRe: minimizing and maximizing Pin
ummu 24-Jan-10 22:21
ummu 24-Jan-10 22:21 
QuestionHow to bookmark in ritchtextbox Pin
SuhebAhamd4-Jan-10 18:12
SuhebAhamd4-Jan-10 18:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.