Click here to Skip to main content

.NET Framework

    RSS: RSS Feed

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page  Show 
  Refresh
QuestionData retrieve using VB.NET PinmemberJayaram Das0:05 23 Nov '09  
AnswerRe: Data retrieve using VB.NET PinmemberNatza Mitzi0:52 23 Nov '09  
GeneralRe: Data retrieve using VB.NET PinmemberTed210221:37 25 Nov '09  
QuestionCustom Date(Time) class..? Pinmembergantww8:32 20 Nov '09  
AnswerRe: Custom Date(Time) class..? PinmemberRichard MacCutchan22:20 20 Nov '09  
AnswerRe: Custom Date(Time) class..? PinmvpPete O'Hanlon3:25 21 Nov '09  
QuestionBig emails are not downloading from the mailserver, appliactions is getting hanged? please help me Pinmembernevincm2:36 20 Nov '09  
Hi all,
 
I dont know in which forum i have to post this issue. If i am wrong please guide me to post in which form
 
I am developing a vb.net desktop application that reads mails from the mailserver using pop and imap .
 
The application is almost fnished .The problem is the some time when a command is send to retrieve a mail using GetMessage() functions the applications is going to a halt
 
So I tried to run the the code in debug mode and ran line by line .
What I noticed is in the while loop in GetMessage() function is
 
While Not tmpString.StartsWith(sPrefix)
tmpString = reader.ReadLine
msg = msg & tmpString & vbCrLf
End While
 
The reader reads line by line at certain point of time it got hangs
 
Some times it ill catch an exception and give an error . I am pasting the exception below
"Received an unexpected EOF or 0 bytes from the transport stream"
 
But some times the applications will hang and go for a halt .This applications has to run 24/7 .So if it hangs in the night or it will be problem .
 
What I want is if the reader is not able to read from the stream after certain time period . the control has to be removed from the reader and the function has to return a message . I am new to this the network level applications and I am running shot of time
So I am in big trouble . If anybody knows this problem please help me
 
I have pasted the code briefly so that you can get an idea about the program
 
Dim objTCP As New TcpClient
Dim sslstream As Net.Security.SslStream
Dim reader As StreamReader = Nothing
objTCP.Connect(IMAPserver, Port)
 
sslstream = New Net.Security.SslStream(objTCP.GetStream())
sslstream.AuthenticateAsClient(IMAPserver) ' authenticate as client GMAIL
AuthStatus = sslstream.IsAuthenticated
reader = New IO.StreamReader(sslstream)
 
Function GetMessage(ByVal sCommand As String, ByVal sslstream As SslStream, ByVal reader As StreamReader) As String
Dim tmpString As String = ""
Dim msg As String = ""
Try
 
sendcmd(sCommand, sslstream)
tmpString = reader.ReadLine()
If tmpString <> "" Then
msg = msg & tmpString & vbCrLf
End If
While Not tmpString.StartsWith(sPrefix)

tmpString = reader.ReadLine
msg = msg & tmpString & vbCrLf
End While
If InStr(msg, "BAD Could not parse command") > 0 Then
'MsgBox("BAD GETMESSAGE")
End If
Catch ex As Exception
appendFile(strErrPath, "Error in GetMessage, BAD command : command : " & sCommand & Space(3) * "User: " & UserName & ex.Message & Date.Now)
End Try
 
Return msg
End Function
AnswerRe: Big emails are not downloading from the mailserver, appliactions is getting hanged? please help me PinmemberNatza Mitzi1:00 23 Nov '09  
Questionhow to connect to a remote system using ssh client Pinmemberhimanshu11011:38 20 Nov '09  
RantRe: how to connect to a remote system using ssh client Pinmemberrootjumper1:44 20 Nov '09  
QuestionReport printing on dotmatrix printer Pinmembersmraj150321:17 19 Nov '09  
AnswerRe: Report printing on dotmatrix printer Pinmembersalkad200723:10 19 Nov '09  
QuestionAsking for mail reception confirmation with SMTPClient [Moved] PinmemberFJJCENTU1:26 19 Nov '09  
GeneralRe: Asking for mail reception confirmation with SMTPClient Pinmemberaspdotnetdev1:33 19 Nov '09  
GeneralRe: Asking for mail reception confirmation with SMTPClient PingroupNorm .net1:36 19 Nov '09  
GeneralRe: Asking for mail reception confirmation with SMTPClient PinmemberRama Krishna Vavilala2:54 19 Nov '09  
GeneralRe: Asking for mail reception confirmation with SMTPClient Pinmemberaspdotnetdev2:14 19 Nov '09  
GeneralRe: Asking for mail reception confirmation with SMTPClient PinmemberMycroft Holmes2:16 19 Nov '09  
GeneralRe: Asking for mail reception confirmation with SMTPClient Pinmemberaspdotnetdev2:19 19 Nov '09  
GeneralRe: Asking for mail reception confirmation with SMTPClient PingroupNorm .net2:33 19 Nov '09  
GeneralRe: Asking for mail reception confirmation with SMTPClient PinmemberMycroft Holmes3:10 19 Nov '09  
QuestionConversion from string "18/8/2009" to type Date is not valid... PinmemberJohnkokk0:36 19 Nov '09  
AnswerRe: Conversion from string "18/8/2009" to type Date is not valid... PinmemberRichard MacCutchan0:48 19 Nov '09  
GeneralRe: Conversion from string "18/8/2009" to type Date is not valid... PinmemberJohnkokk0:59 19 Nov '09  
GeneralRe: Conversion from string "18/8/2009" to type Date is not valid... PinmemberJohnkokk1:24 19 Nov '09  

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

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


Advertise | Privacy | Mobile
Web02 | 2.5.120210.1 | Last Updated 10 Feb 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid