Example #1
0
		public SocketAsyncEventArgs ()
		{
			Worker = new Socket.Worker (this);
			AcceptSocket = null;
			Buffer = null;
			BufferList = null;
			BytesTransferred = 0;
			Count = 0;
			DisconnectReuseSocket = false;
			LastOperation = SocketAsyncOperation.None;
			Offset = 0;
			RemoteEndPoint = null;
#if !NET_2_1
			SendPacketsElements = null;
			SendPacketsFlags = TransmitFileOptions.UseDefaultWorkerThread;
#endif
			SendPacketsSendSize = -1;
			SocketError = SocketError.Success;
			SocketFlags = SocketFlags.None;
			UserToken = null;

#if MOONLIGHT && !INSIDE_SYSTEM
			policy_protocol = SocketClientAccessPolicyProtocol.Tcp;
#endif
		}
Example #2
0
		void Dispose (bool disposing)
		{
			disposed = true;

			if (disposing) {
				if (disposed || Interlocked.CompareExchange (ref in_progress, 0, 0) != 0)
					return;
				if (Worker != null) {
					Worker.Dispose ();
					Worker = null;
				}
			}
			AcceptSocket = null;
			Buffer = null;
			BufferList = null;
			RemoteEndPoint = null;
			UserToken = null;
#if !NET_2_1
			SendPacketsElements = null;
#endif
		}		
		void Dispose (bool disposing)
		{
			if (disposing) {
				if (Worker != null) {
					Worker.Dispose ();
					Worker = null;
				}
			}
			AcceptSocket = null;
			Buffer = null;
			BufferList = null;
			RemoteEndPoint = null;
			UserToken = null;
#if !NET_2_1
			SendPacketsElements = null;
#endif
		}