2005-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / Mono.Security / Mono.Security.Protocol.Tls / SslClientStream.cs
index 2ee0448a5f421c874e00c4206a9b450596cd9eda..22e197b6b15545694d4ae2f8f0585d3ef16234cc 100644 (file)
@@ -76,6 +76,7 @@ namespace Mono.Security.Protocol.Tls
                private object                                                  negotiate;
                private object                                                  read;
                private object                                                  write;
+               private ReadDelegate                                            rd;
 
                #endregion
 
@@ -482,7 +483,7 @@ namespace Mono.Security.Protocol.Tls
                                        }
 
                                        // return the record(s) to the caller
-                                       ReadDelegate rd = new ReadDelegate (this.inputBuffer.Read);
+                                       rd = new ReadDelegate (this.inputBuffer.Read);
                                        asyncResult = rd.BeginInvoke (buffer, offset, count, callback, state);
                                }
                                catch (TlsException ex)
@@ -675,7 +676,7 @@ namespace Mono.Security.Protocol.Tls
                        }\r
 
                        recordEvent.Reset ();
-                       return this.inputBuffer.EndRead (asyncResult);
+                       return this.rd.EndInvoke (asyncResult);
                }
 
                public override void EndWrite(IAsyncResult asyncResult)