Welcome to Dream.In.Code
Become a C# Expert!

Join 150,394 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,033 people online right now. Registration is fast and FREE... Join Now!




How to close properly the connection with POP3 server?

 
Reply to this topicStart new topic

How to close properly the connection with POP3 server?

cygnusX
11 Mar, 2008 - 08:05 AM
Post #1

D.I.C Head
**

Joined: 19 May, 2007
Posts: 159



Thanked: 2 times
My Contributions
I want to disconnect from the server and then to connect again after certain amount of time.When disconnecting i have to send only the "quit" command or to send quit and after i receive "+OK Farewell"(or whatever it is) to close the network stream and the socket?Which of these two "methods" is correct?

CODE

TcpClient client = new TcpClient();
SslStream netStream;

client.Connect("pop.gmail.com", 995);
netStream = new SslStream(client.GetStream());
netStream.AuthenticateAsClient("pop.gmail.com");


User is offlineProfile CardPM
+Quote Post

zakary
RE: How To Close Properly The Connection With POP3 Server?
11 Mar, 2008 - 08:26 AM
Post #2

D.I.C Regular
Group Icon

Joined: 15 Feb, 2005
Posts: 420



Thanked: 8 times
Dream Kudos: 175
My Contributions
client.Close();
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 06:09PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month