Click here to Skip to main content
15,885,366 members
Home / Discussions / C#
   

C#

 
GeneralRe: Why The remote server returned an error: (403) Forbidden? Pin
Le centriste13-Sep-07 1:14
Le centriste13-Sep-07 1:14 
GeneralRe: Why The remote server returned an error: (403) Forbidden? Pin
bug_aonz13-Sep-07 16:30
bug_aonz13-Sep-07 16:30 
QuestionSearch for a file Pin
P_Elza12-Sep-07 23:51
P_Elza12-Sep-07 23:51 
AnswerRe: Search for a file Pin
Pete O'Hanlon12-Sep-07 23:59
mvePete O'Hanlon12-Sep-07 23:59 
QuestionInserting a formula in excel Pin
lourensG12-Sep-07 23:51
lourensG12-Sep-07 23:51 
AnswerRe: Inserting a formula in excel Pin
Jimmanuel13-Sep-07 3:02
Jimmanuel13-Sep-07 3:02 
GeneralRe: Inserting a formula in excel Pin
lourensG13-Sep-07 3:10
lourensG13-Sep-07 3:10 
QuestionStrange Issue:Window Service Pin
ramdil12-Sep-07 23:48
ramdil12-Sep-07 23:48 
Hi All
I am facing a strange issue and i am working on this issue for last one week,but i am not able to find it.I have a window service which reads the MSMQ .This windows service will do only this function.Now, when some thing is written to MSMQ, window service will read the msmq.Now there is nothing in queue ,then also it will loop and if some thing comes inside the msmq then again it will read ...this works fine if i am doing in regular intervals.
Now if am not doing any operations for two or three hours ,then status of windows service will be started but it will not reading the msmq,and it is not throwing any error..also...this is the strange thing i am facing..why it is behaving like this.Can any one help me in this idea.I am pasting the start section of of mywindows service here .can any one tell me what is wrong in this code.Thanks in advance

this code i am calling inside a thread..

try
{
MessageQueue mq = null;
System.Messaging.Message msg = null;
while(true)
{
//MessageQueue mq = null;
//System.Messaging.Message msg = null;
try
{
if(mq == null)
{
mq = new System.Messaging.MessageQueue (XMLReprocessMSMQPath);
}
RemoteLoggingManager.LogMessage(LoggingMessageTypes.Error, APPLICATIONNAME,"Read Queue", LoggingMessageTargets.Both);
msg = mq.Receive(new TimeSpan(0,0,0,10,0));
RemoteLoggingManager.LogMessage(LoggingMessageTypes.Error, APPLICATIONNAME,"Data Rec", LoggingMessageTargets.Both);
msg.Formatter = new ActiveXMessageFormatter();
XMLReprocessMSMQFileName=ReceiveMessage(msg.Body.ToString());
SendXMLToWebervice(XMLReprocessMSMQFileName);
}
catch (System.Messaging.MessageQueueException ex)
{
if(ex.ErrorCode != -2147467259) // Ignore timeout error
{
RemoteLoggingManager.LogMessage(LoggingMessageTypes.Error, APPLICATIONNAME,ex.ToString(), LoggingMessageTargets.Both);
mq.Close();
mq.Dispose();
mq = null;
MessageQueue.ClearConnectionCache();
Thread.Sleep(10000);
}
else
{
mq = null;
}
}
catch (Exception ex)
{
RemoteLoggingManager.LogMessage(LoggingMessageTypes.Error, APPLICATIONNAME,ex.ToString(), LoggingMessageTargets.Both);
mq.Close();
mq.Dispose();
mq = null;
MessageQueue.ClearConnectionCache();
}
}
}
catch(Exception ex)
{
RemoteLoggingManager.LogMessage(LoggingMessageTypes.Information , APPLICATIONNAME,
"Reprocess MSMQ Catch block :" + DateTime.Now.ToLongTimeString(), LoggingMessageTargets.Both);
}
finally
{
RemoteLoggingManager.LogMessage(LoggingMessageTypes.Information , APPLICATIONNAME,"Finally block executed " +
DateTime.Now.ToLongTimeString(), LoggingMessageTargets.Both);
}



Regards
DilipRam

QuestionRemoting events sometimes failing Pin
Lasse Offt12-Sep-07 23:43
Lasse Offt12-Sep-07 23:43 
AnswerRe: Remoting events sometimes failing Pin
Lasse Offt13-Sep-07 21:19
Lasse Offt13-Sep-07 21:19 
AnswerRe: Remoting events sometimes failing Pin
John Whitmire2-Nov-07 6:17
professionalJohn Whitmire2-Nov-07 6:17 
QuestionString table equivalent in C# Pin
Keshav V. Kamat12-Sep-07 23:42
Keshav V. Kamat12-Sep-07 23:42 
AnswerRe: String table equivalent in C# Pin
Paul Conrad14-Sep-07 19:06
professionalPaul Conrad14-Sep-07 19:06 
QuestionUsing C , C++, VC++ code libraries in C#.net Pin
venkatinaidu12-Sep-07 23:39
venkatinaidu12-Sep-07 23:39 
AnswerRe: Using C , C++, VC++ code libraries in C#.net Pin
Giorgi Dalakishvili12-Sep-07 23:47
mentorGiorgi Dalakishvili12-Sep-07 23:47 
Question.NET dll in asp/vb code Pin
mpavas12-Sep-07 23:32
mpavas12-Sep-07 23:32 
AnswerRe: .NET dll in asp/vb code Pin
Sandeep Akhare12-Sep-07 23:33
Sandeep Akhare12-Sep-07 23:33 
GeneralRe: .NET dll in asp/vb code Pin
mpavas12-Sep-07 23:36
mpavas12-Sep-07 23:36 
GeneralRe: .NET dll in asp/vb code Pin
Sandeep Akhare12-Sep-07 23:42
Sandeep Akhare12-Sep-07 23:42 
GeneralRe: .NET dll in asp/vb code Pin
mpavas12-Sep-07 23:45
mpavas12-Sep-07 23:45 
AnswerRe: .NET dll in asp/vb code Pin
mpavas12-Sep-07 23:33
mpavas12-Sep-07 23:33 
QuestionTHE FAST FUNCTION TO READ / WRITE FILE? Pin
AlexB4712-Sep-07 23:26
AlexB4712-Sep-07 23:26 
AnswerRe: THE FAST FUNCTION TO READ / WRITE FILE? Pin
lmoelleb13-Sep-07 0:15
lmoelleb13-Sep-07 0:15 
Questiontransparent maskededit box? Pin
TheCardinal12-Sep-07 23:25
TheCardinal12-Sep-07 23:25 
QuestionNetron Pin
Mamphekgo Bahula12-Sep-07 22:59
Mamphekgo Bahula12-Sep-07 22:59 

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.