PowerTCP Mail for .NET
BeginLogout Method
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > Pop Class : BeginLogout Method




state
Asynchronously ceases all activity and gracefully closes the connection.

Syntax

Visual Basic (Declaration) 
Public Function BeginLogout( _
   ByVal state As Object _
) As IAsyncResult
Visual Basic (Usage)Copy Code
Dim instance As Pop
Dim state As Object
Dim value As IAsyncResult
 
value = instance.BeginLogout(state)
C# 
public IAsyncResult BeginLogout( 
   object state
)
Managed Extensions for C++ 
public: IAsyncResult* BeginLogout( 
   Object* state
) 
C++/CLI 
public:
IAsyncResult^ BeginLogout( 
   Object^ state
) 

Parameters

state

Return Value

An IAsyncResult that represents the asynchronous operation, which could still be pending.

Exceptions

ExceptionDescription
Dart.PowerTCP.Mail.ProtocolExceptionBad POP protocol response received from server.
System.InvalidOperationExceptionPop.BeginClose used without providing an EndSend event handler.
System.Net.Sockets.SocketExceptionThe requested address is not valid in its context.
System.IO.IOExceptionThe filename, directory name, or volume label syntax is incorrect.
System.ArgumentExceptionA required argument contains invalid characters, is empty, or contains only white spaces.

Remarks

This method begins to close the connection to a POP server. Upon completion the Pop.EndLogout event will be raised. A PopEventArgs object will be passed into this event, containing data about the connection close operation. If any messages were marked for deletion, these deletes will occur after calling this method. If you are using the Pop component as a reference, you must "wire up" the event yourself. This involves creating a method that acts as the event handler that implements the PopEventHandler delegate. See Using Events When Using A Component As A Reference for more information.

Use this method if you wish to close a connection with minimal application impact, as execution occurs on another thread.

The object state is useful for any kind of state information that you would like accessible in the Pop.EndLogout event. Since the method is "disconnected" from the calling code and returns to the calling thread elsewhere, you may wish to pass an object/variable as state to be retrieved and used in the event handler.

To send an email message synchronously, use Pop.Logout.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.