Click here to Skip to main content
15,893,266 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: window.showModalDialog? Pin
darkyro27-Nov-09 12:09
darkyro27-Nov-09 12:09 
QuestionData retrieve using VB.NET Pin
Jayaram Das22-Nov-09 23:05
Jayaram Das22-Nov-09 23:05 
AnswerRe: Data retrieve using VB.NET Pin
Natza Mitzi22-Nov-09 23:52
Natza Mitzi22-Nov-09 23:52 
GeneralRe: Data retrieve using VB.NET Pin
T210225-Nov-09 20:37
T210225-Nov-09 20:37 
QuestionCustom Date(Time) class..? Pin
gantww20-Nov-09 7:32
gantww20-Nov-09 7:32 
AnswerRe: Custom Date(Time) class..? Pin
Richard MacCutchan20-Nov-09 21:20
mveRichard MacCutchan20-Nov-09 21:20 
AnswerRe: Custom Date(Time) class..? Pin
Pete O'Hanlon21-Nov-09 2:25
mvePete O'Hanlon21-Nov-09 2:25 
QuestionBig emails are not downloading from the mailserver, appliactions is getting hanged? please help me Pin
nevincm20-Nov-09 1:36
nevincm20-Nov-09 1:36 
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 Pin
Natza Mitzi23-Nov-09 0:00
Natza Mitzi23-Nov-09 0:00 
Questionhow to connect to a remote system using ssh client Pin
himanshu110120-Nov-09 0:38
himanshu110120-Nov-09 0:38 
RantRe: how to connect to a remote system using ssh client Pin
freakyit20-Nov-09 0:44
freakyit20-Nov-09 0:44 
QuestionReport printing on dotmatrix printer Pin
smraj150319-Nov-09 20:17
smraj150319-Nov-09 20:17 
AnswerRe: Report printing on dotmatrix printer Pin
salkad200719-Nov-09 22:10
salkad200719-Nov-09 22:10 
QuestionAsking for mail reception confirmation with SMTPClient [Moved] Pin
FJJCENTU19-Nov-09 0:26
FJJCENTU19-Nov-09 0:26 
GeneralRe: Asking for mail reception confirmation with SMTPClient Pin
AspDotNetDev19-Nov-09 0:33
protectorAspDotNetDev19-Nov-09 0:33 
GeneralRe: Asking for mail reception confirmation with SMTPClient Pin
NormDroid19-Nov-09 0:36
professionalNormDroid19-Nov-09 0:36 
GeneralRe: Asking for mail reception confirmation with SMTPClient Pin
Rama Krishna Vavilala19-Nov-09 1:54
Rama Krishna Vavilala19-Nov-09 1:54 
GeneralRe: Asking for mail reception confirmation with SMTPClient Pin
AspDotNetDev19-Nov-09 1:14
protectorAspDotNetDev19-Nov-09 1:14 
GeneralRe: Asking for mail reception confirmation with SMTPClient Pin
Mycroft Holmes19-Nov-09 1:16
professionalMycroft Holmes19-Nov-09 1:16 
GeneralRe: Asking for mail reception confirmation with SMTPClient Pin
AspDotNetDev19-Nov-09 1:19
protectorAspDotNetDev19-Nov-09 1:19 
GeneralRe: Asking for mail reception confirmation with SMTPClient Pin
NormDroid19-Nov-09 1:33
professionalNormDroid19-Nov-09 1:33 
GeneralRe: Asking for mail reception confirmation with SMTPClient Pin
Mycroft Holmes19-Nov-09 2:10
professionalMycroft Holmes19-Nov-09 2:10 
QuestionConversion from string "18/8/2009" to type Date is not valid... Pin
Johnkokk18-Nov-09 23:36
Johnkokk18-Nov-09 23:36 
AnswerRe: Conversion from string "18/8/2009" to type Date is not valid... Pin
Richard MacCutchan18-Nov-09 23:48
mveRichard MacCutchan18-Nov-09 23:48 
GeneralRe: Conversion from string "18/8/2009" to type Date is not valid... Pin
Johnkokk18-Nov-09 23:59
Johnkokk18-Nov-09 23: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.