Merge pull request #3769 from evincarofautumn/fix-verify-before-allocs
[mono.git] / mcs / class / System / System.Net.Sockets / SocketAsyncEventArgs.cs
index 361f55ec929b450e147b04dbfb7a07794b36f485..419035efe15fe3ad31aac61aa2ba427ccc397620 100644 (file)
@@ -61,13 +61,13 @@ namespace System.Net.Sockets
                        private set;
                }
 
-               IList <ArraySegment <byte>> _bufferList;
+               internal IList<ArraySegment<byte>> m_BufferList;
                public IList<ArraySegment<byte>> BufferList {
-                       get { return _bufferList; }
+                       get { return m_BufferList; }
                        set {
                                if (Buffer != null && value != null)
                                        throw new ArgumentException ("Buffer and BufferList properties cannot both be non-null.");
-                               _bufferList = value;
+                               m_BufferList = value;
                        }
                }
 
@@ -111,12 +111,10 @@ namespace System.Net.Sockets
                        set;
                }
 
-#if !MOBILE
                public TransmitFileOptions SendPacketsFlags {
                        get;
                        set;
                }
-#endif
 
                [MonoTODO ("unused property")]
                public int SendPacketsSendSize {
@@ -179,13 +177,6 @@ namespace System.Net.Sockets
 
                        if (disposing && in_progress != 0)
                                return;
-
-                       AcceptSocket = null;
-                       Buffer = null;
-                       BufferList = null;
-                       RemoteEndPoint = null;
-                       UserToken = null;
-                       SendPacketsElements = null;
                }
 
                public void Dispose ()
@@ -243,5 +234,43 @@ namespace System.Net.Sockets
 
                        Buffer = buffer;
                }
+
+               internal void StartOperationCommon (Socket socket)
+               {
+                       current_socket = socket;
+               }
+
+               internal void StartOperationWrapperConnect (MultipleConnectAsync args)
+               {
+                       SetLastOperation (SocketAsyncOperation.Connect);
+
+                       //m_MultipleConnect = args;
+               }
+
+               internal void FinishConnectByNameSyncFailure (Exception exception, int bytesTransferred, SocketFlags flags)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal void FinishOperationAsyncFailure (Exception exception, int bytesTransferred, SocketFlags flags)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal void FinishWrapperConnectSuccess (Socket connectSocket, int bytesTransferred, SocketFlags flags)
+               {
+                       SetResults(SocketError.Success, bytesTransferred, flags);
+                       current_socket = connectSocket;
+
+                       Complete ();
+                       OnCompleted (this);
+               }
+
+               internal void SetResults (SocketError socketError, int bytesTransferred, SocketFlags flags)
+               {
+                       SocketError = socketError;
+                       BytesTransferred = bytesTransferred;
+                       SocketFlags = flags;
+               }
        }
 }