当前位置: 首页>>代码示例>>C#>>正文


C# VirtualMachine.connect方法代码示例

本文整理汇总了C#中VirtualMachine.connect方法的典型用法代码示例。如果您正苦于以下问题:C# VirtualMachine.connect方法的具体用法?C# VirtualMachine.connect怎么用?C# VirtualMachine.connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VirtualMachine的用法示例。


在下文中一共展示了VirtualMachine.connect方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LaunchInternal

		public static VirtualMachine LaunchInternal (ITargetProcess p, ProcessStartInfo info, Socket socket) {
			Socket accepted = null;
			try {
				accepted = socket.Accept ();
			} catch (Exception) {
				throw;
			}

			Connection conn = new TcpConnection (accepted);

			VirtualMachine vm = new VirtualMachine (p, conn);

			if (info.RedirectStandardOutput)
				vm.StandardOutput = p.StandardOutput;

			if (info.RedirectStandardError)
				vm.StandardError = p.StandardError;

			conn.EventHandler = new EventHandler (vm);

			vm.connect ();

			return vm;
		}
开发者ID:shana,项目名称:Mono.Debugger.Soft,代码行数:24,代码来源:VirtualMachineManager.cs

示例2: Connect

		public static VirtualMachine Connect (Connection transport, StreamReader standardOutput, StreamReader standardError)
		{
			VirtualMachine vm = new VirtualMachine (null, transport);

			vm.StandardOutput = standardOutput;
			vm.StandardError = standardError;

			transport.EventHandler = new EventHandler (vm);

			vm.connect ();

			return vm;
		}
开发者ID:shana,项目名称:Mono.Debugger.Soft,代码行数:13,代码来源:VirtualMachineManager.cs

示例3: ListenInternal

		public static VirtualMachine ListenInternal (Socket dbg_sock, Socket con_sock) {
			Socket con_acc = null;
			Socket dbg_acc = null;

			if (con_sock != null) {
				try {
					con_acc = con_sock.Accept ();
				} catch (Exception) {
					try {
						dbg_sock.Close ();
					} catch {}
					throw;
				}
			}
						
			try {
				dbg_acc = dbg_sock.Accept ();
			} catch (Exception) {
				if (con_sock != null) {
					try {
						con_sock.Close ();
						con_acc.Close ();
					} catch {}
				}
				throw;
			}

			if (con_sock != null) {
				if (con_sock.Connected)
					con_sock.Disconnect (false);
				con_sock.Close ();
			}

			if (dbg_sock.Connected)
				dbg_sock.Disconnect (false);
			dbg_sock.Close ();

			Connection conn = new Connection (dbg_acc);

			VirtualMachine vm = new VirtualMachine (null, conn);

			if (con_acc != null) {
				vm.StandardOutput = new StreamReader (new NetworkStream (con_acc));
				vm.StandardError = null;
			}

			conn.EventHandler = new EventHandler (vm);

			vm.connect ();

			return vm;
		}
开发者ID:pasko,项目名称:mono,代码行数:52,代码来源:VirtualMachineManager.cs

示例4: ConnectInternal

		public static VirtualMachine ConnectInternal (Socket dbg_sock, Socket con_sock, IPEndPoint dbg_ep, IPEndPoint con_ep) {
			if (con_sock != null) {
				try {
					con_sock.Connect (con_ep);
				} catch (Exception) {
					try {
						dbg_sock.Close ();
					} catch {}
					throw;
				}
			}
						
			try {
				dbg_sock.Connect (dbg_ep);
			} catch (Exception) {
				if (con_sock != null) {
					try {
						con_sock.Close ();
					} catch {}
				}
				throw;
			}

			Connection conn = new Connection (dbg_sock);

			VirtualMachine vm = new VirtualMachine (null, conn);

			if (con_sock != null) {
				vm.StandardOutput = new StreamReader (new NetworkStream (con_sock));
				vm.StandardError = null;
			}

			conn.EventHandler = new EventHandler (vm);

			vm.connect ();

			return vm;
		}
开发者ID:pasko,项目名称:mono,代码行数:38,代码来源:VirtualMachineManager.cs

示例5: Connect

		/*
		 * Connect to a virtual machine listening at the specified address.
		 */
		public static VirtualMachine Connect (IPEndPoint endpoint) {
			if (endpoint == null)
				throw new ArgumentNullException ("endpoint");

			Socket socket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
			socket.Connect (endpoint);

			Connection conn = new Connection (socket);

			VirtualMachine vm = new VirtualMachine (null, conn);

			conn.EventHandler = new EventHandler (vm);

			vm.connect ();

			return vm;
		}
开发者ID:stabbylambda,项目名称:mono,代码行数:20,代码来源:VirtualMachineManager.cs


注:本文中的VirtualMachine.connect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。