Click here to Skip to main content
15,919,434 members
Home / Discussions / C#
   

C#

 
QuestionMSMQ Error Handling Pin
ramdil17-Jul-07 1:38
ramdil17-Jul-07 1:38 
AnswerRe: MSMQ Error Handling Pin
Jimmanuel17-Jul-07 3:55
Jimmanuel17-Jul-07 3:55 
GeneralRe: MSMQ Error Handling Pin
ramdil17-Jul-07 4:24
ramdil17-Jul-07 4:24 
GeneralRe: MSMQ Error Handling Pin
Jimmanuel17-Jul-07 4:35
Jimmanuel17-Jul-07 4:35 
GeneralRe: MSMQ Error Handling Pin
ramdil17-Jul-07 5:35
ramdil17-Jul-07 5:35 
GeneralRe: MSMQ Error Handling Pin
Jimmanuel17-Jul-07 6:10
Jimmanuel17-Jul-07 6:10 
GeneralRe: MSMQ Error Handling Pin
ramdil17-Jul-07 6:23
ramdil17-Jul-07 6:23 
GeneralRe: MSMQ Error Handling [modified] Pin
Jimmanuel17-Jul-07 6:45
Jimmanuel17-Jul-07 6:45 
no, Thread.Sleep won't do what you want, all it'll accomplish is to make the Thread wait for 100 more ms before it executes the next iteration of the loop. The way that it is currently written it will accomplish what you're describing, but you still need to add the line "IsMessageRecieved = false;" into the try block after the message has successfully been read like this:
try
{
   msg = mq.Receive(new TimeSpan(0,0,100));
   XMLMSMQFileName = msg.Body.ToString();
   IsMessageRecieved = false;
}
catch . . .

this will make it so that if a message is received successfully then IsMessageRecieved will be set to false and the while loop will be exited but if the Receive method times out then the line IsMessageRecieved = false; is skipped and the loop is repeated



Last modified: 10mins after originally posted -- corrected IsMessageRecieved = true; to IsMessageRecieved = false;



GeneralRe: MSMQ Error Handling Pin
ramdil17-Jul-07 7:15
ramdil17-Jul-07 7:15 
GeneralRe: MSMQ Error Handling Pin
Jimmanuel17-Jul-07 7:27
Jimmanuel17-Jul-07 7:27 
GeneralRe: MSMQ Error Handling Pin
ramdil17-Jul-07 22:28
ramdil17-Jul-07 22:28 
QuestionRemote method calls Pin
kkadir17-Jul-07 1:33
kkadir17-Jul-07 1:33 
AnswerRe: Remote method calls Pin
Malcolm Smart17-Jul-07 1:41
Malcolm Smart17-Jul-07 1:41 
GeneralRe: Remote method calls Pin
kkadir17-Jul-07 2:17
kkadir17-Jul-07 2:17 
GeneralRe: Remote method calls Pin
Malcolm Smart17-Jul-07 2:51
Malcolm Smart17-Jul-07 2:51 
QuestionGetting the user default locale identifier in c# Pin
Tal S.17-Jul-07 0:51
Tal S.17-Jul-07 0:51 
AnswerRe: Getting the user default locale identifier in c# Pin
Le centriste17-Jul-07 2:16
Le centriste17-Jul-07 2:16 
GeneralRe: Getting the user default locale identifier in c# Pin
Tal S.18-Jul-07 3:49
Tal S.18-Jul-07 3:49 
QuestionDebugging the windows service Pin
M. J. Jaya Chitra17-Jul-07 0:43
M. J. Jaya Chitra17-Jul-07 0:43 
AnswerRe: Debugging the windows service Pin
Nisar Inamdar17-Jul-07 0:56
Nisar Inamdar17-Jul-07 0:56 
AnswerRe: Debugging the windows service Pin
originSH17-Jul-07 1:00
originSH17-Jul-07 1:00 
GeneralRe: Debugging the windows service Pin
M. J. Jaya Chitra17-Jul-07 18:11
M. J. Jaya Chitra17-Jul-07 18:11 
AnswerRe: Debugging the windows service Pin
Harkamal Singh17-Jul-07 6:58
Harkamal Singh17-Jul-07 6:58 
GeneralRe: Debugging the windows service Pin
M. J. Jaya Chitra17-Jul-07 18:10
M. J. Jaya Chitra17-Jul-07 18:10 
QuestionKey Press Event Pin
Xmen Real 17-Jul-07 0:37
professional Xmen Real 17-Jul-07 0:37 

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.