草庐IT

CONNECTION_RESET

全部标签

windows - 引导时 Vagrant 'remote connection disconnect'

每当我尝试在我的Windows7x64笔记本电脑上使用vagrantup在gitbash中启动Vagrantbox时,我都会收到一长串Warning:Remote连接断开。正在重试...消息。有时这会导致失败并显示几条不同的消息(未安装guestVM工具或超时),但有时,在10或15条消息后,它会成功启动,我可以通过SSH进入。一张图来说明:vagrantup命令的完整输出:$vagrantupBringingmachine'default'upwith'virtualbox'provider...==>default:Checkingifbox'ianwalter/ubuntu-no

winapi - 用于虚拟内存管理的新 Windows 8.1 API : `DiscardVirtualMemory()` vs `VirtualAlloc()` and `MEM_RESET` and `MEM_RESET_UNDO`

Windows8.1/Server2012RC2刚刚引入了用于虚拟内存管理的新API:OfferVirtualMemory()、ReclaimVirtualMemory()、DiscardVirtualMemory()、它们的用法非常简单,只需查看它们的名称即可。我无法理解这些API如何针对VirtualAlloc()以及标志MEM_RESET和MEM_RESET_UNDO工作,以及什么是细微差别。对于OfferVirtualMemory(),MSDN说它与VirtualAlloc()+MEM_RESET非常相似,只是它从工作集,并限制对页面的进一步访问。所以,基本上它限制了对页面的访

c# - 重现 "A connection that was expected to be kept alive was closed by the server."

我们在winforms应用程序中使用WebClient、.NET3.5sp1。对于一些用户来说,这个结果在消息异常中:“基础连接已关闭:服务器关闭了预期保持事件状态的连接。”在网络上搜索了一下,建议“修复”以禁用httpkeepalive,我们对此并不真正感兴趣,有人认为它可能是.NET库中的错误,等等。错误消息表明它是一个keepaliv'edhttp连接,它以某种方式被服务器(或代理)关闭,而WebClient的底层未正确检测到它。我们正在考虑捕获这个特定案例,然后再次尝试该请求。但是我们无法重现此异常。所以。我们如何才能正确捕获产生上述错误消息的情况。catch(WebExcep

c# - List<T>.Enumerator 的 Reset 方法的行为

以下两种方法(一种使用IEnumerator,另一种使用List.Enumerator)即使看起来相同会产生不同的结果。staticvoidM1(){varlist=newList(){1,2,3,4};IEnumeratoriterator=list.GetEnumerator();while(iterator.MoveNext()){Console.Write(iterator.Current);}iterator.Reset();while(iterator.MoveNext()){Console.Write(iterator.Current);}}staticvoidM2(){

c# - connection.Close() 和 connection.Dispose() 有什么区别?

这个问题在这里已经有了答案:CloseandDispose-whichtocall?(8个答案)关闭9年前。我注意到System.Data.SQLite中的SQLiteConnection对象拥有两个相似的方法:关闭()Dispose()SQLiteDataReader对象也是如此。有什么区别?

c# - 尝试读取 xml 文件时的 ASP.Net, "An operation was attempted on a nonexistent network connection"

stringurl="http://www.example.com/feed.xml";varsettings=newXmlReaderSettings();settings.IgnoreComments=true;settings.IgnoreProcessingInstructions=true;settings.IgnoreWhitespace=true;settings.XmlResolver=null;settings.DtdProcessing=DtdProcessing.Parse;settings.CheckCharacters=false;varrequest=(Ht

c# - 错误 : ExecuteReader requires an open and available Connection. 连接的当前状态为打开

我有下面带有DataHelperClass的mvc4网站来执行查询。我的问题有时是,网站以异常为标题。我使用block来处理SqlCommand和SqlDataAdapter但没有成功。请帮助我,对不起我的英语。try{if(_conn.State==ConnectionState.Closed)_conn.Open();using(SqlCommandsqlCommand=newSqlCommand(query,_conn)){sqlCommand.CommandType=CommandType.StoredProcedure;if(parameters!=null)sqlComma

c# - Db Connection.State Change 什么时候调用?

我有以下代码:classProgram{staticvoidMain(){varconnection=newSqlConnection("myConnectionString");connection.Open();connection.StateChange+=HandleSqlConnectionDrop;Console.WriteLine("Hi");Console.ReadLine();}privatestaticvoidHandleSqlConnectionDrop(objectconnection,StateChangeEventArgsargs){Console.Writ

c# - 在C#应用程序中,DB Connection应该创建一次,还是每次执行SQL语句时创建一次?

在C#应用程序中,OleDBConnection应该创建一次,还是每次执行SQL语句时创建一次?我正在查看其他人编写的C#代码。每个SQL语句之前都会创建一个OleDbConnection对象,该对象的连接字符串指向MDB数据库。每次都创建一个OleDbConnection对象是否合适,或者该对象是否应该在应用程序启动时创建并从那时起使用。 最佳答案 根据BestPracticesforUsingADO.NET:Highperformanceapplicationskeepconnectionstothedatasourceinus

c# - 无法从传输连接读取数据 : The connection was closed error in console application

我在控制台应用程序中有这段代码,它在一个循环中运行try{HttpWebRequestrequest=(HttpWebRequest)WebRequest.Create(search);request.Headers.Add("Accept-Language","de-DE");request.Method="GET";request.Accept="text/html";using(HttpWebResponseresponse=(HttpWebResponse)request.GetResponse()){using(StreamReaderreader=newStreamRead