PowerTCP Mail for .NET
ReceiveTimeout Property
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > Tcp Class : ReceiveTimeout Property




Gets and sets the number of milliseconds that a Tcp.Receive method will block before throwing a SocketException.

Syntax

Visual Basic (Declaration) 
<CategoryAttribute("Socket Options")>
<DefaultValueAttribute()>
<DescriptionAttribute("Gets and Sets the number of milli-seconds that a socket Receive() method will block before throwing a SocketException.")>
Public Property ReceiveTimeout As Integer
Visual Basic (Usage)Copy Code
Dim instance As Tcp
Dim value As Integer
 
instance.ReceiveTimeout = value
 
value = instance.ReceiveTimeout
C# 
[CategoryAttribute("Socket Options")]
[DefaultValueAttribute()]
[DescriptionAttribute("Gets and Sets the number of milli-seconds that a socket Receive() method will block before throwing a SocketException.")]
public int ReceiveTimeout {get; set;}
Managed Extensions for C++ 
[CategoryAttribute("Socket Options")]
[DefaultValueAttribute()]
[DescriptionAttribute("Gets and Sets the number of milli-seconds that a socket Receive() method will block before throwing a SocketException.")]
public: __property int get_ReceiveTimeout();
public: __property void set_ReceiveTimeout( 
   int value
);
C++/CLI 
[CategoryAttribute("Socket Options")]
[DefaultValueAttribute()]
[DescriptionAttribute("Gets and Sets the number of milli-seconds that a socket Receive() method will block before throwing a SocketException.")]
public:
property int ReceiveTimeout {
   int get();
   void set (    int value);
}

Property Value

The timeout (in milliseconds) for completing a blocking Tcp.Receive or Tcp.Stream.Read.

Remarks

The Tcp component will block (not execute further code on the main thread) until either the data requested is received or until the method blocks for the time specified in Tcp.ReceiveTimeout, at which point a SocketException is thrown. The default is 0, which indicates no timeout. When using Tcp.BeginReceive, the EndReceive event will fire with a SocketException, if the ReceiveTimeout period expires.

This property is useful for determining network failure while receiving data. It is also useful for cases where the response from the server has to occur quickly or not at all, such as in an ASP script or when connecting and receiving data from a series of sockets in a batch process.

If building a server application, this value determines how long a child connection can be idle before disconnecting them.

Note: If the ReceiveTimeout period expires, the resulting SocketException will NOT cause the connection to sever. This is different behavior that earlier versions of the Tcp object.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

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