草庐IT

connection_specification

全部标签

windows - 连接(): WSAECONNREFUSED on connect

我正在尝试使用Connectapi连接到设备。它给我WSAECONNREFUSED错误。当我连接了两个设备并尝试连接到其中一个设备时,就会发生这种情况。如果我只连接一台设备,那么connectino会正常运行。你们谁能告诉我这里的问题。这是我的代码:sockaddr_inmy_addr;my_addr.sin_family=(USHORT)AF_INET;my_addr.sin_port=htons((USHORT)host_port);memset(&(my_addr.sin_zero),0,(size_t)8);my_addr.sin_addr.s_addr=inet_addr(p

python - 运行 fully_connected_feed.py 时出错

当我运行fully_connected_feed.py代码时:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/mnist/fully_connected_feed.py我得到一个错误:Traceback(mostrecentcalllast):File"C:/Users/AppData/Local/Continuum/Anaconda3/Lib/site-packages/tensorflow/examples/tutorials/mnist/fully_connect

.NET/WinForms : maximize a window on a specific screen

我有一个双显示器设置,我希望我的C#应用程序在特定屏幕上最大化其窗口。我该怎么做?谢谢! 最佳答案 这是我的一个项目中类似范围的屏幕管理代码://screenIdinmycaseis1(first)or2(second)intscreenId=RegistryManager.ScreenId;//DualScreenmanagementif(screenId>0){//Have2screensif(System.Windows.Forms.Screen.AllScreens.Length==2){if(screenId==1)//f

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# - connection.Close() 和 connection.Dispose() 有什么区别?

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

c# - VS2013 : Memory profiler doesn't show anything on a specific project

我想使用visualstudio2013ultimate的内存分析器来分析WPF应用程序。但似乎有一个问题:运行探查器后没有可用/显示的数据。我使用Windows8.1x64我收到这个错误:DA0002:ItappearsthatthefilewascollectedwithoutproperlysettingtheenvironmentvariableswithVSPerfCLREnv.cmd.Symbolsformanagedbinariesmaynotresolve.奇怪的是:CPU分析适用于此项目,而内存分析似乎适用于其他项目(我创建了一个带有空窗口的新WPF项目并在那里测试了

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# - Tridion 2011 核心服务 : Unable to connect in a SSO environment

尝试连接到核心服务时出现以下错误:TheHTTPrequestwasforbiddenwithclientauthenticationscheme'Anonymous'Tridion环境配置了来自SiteMinder的SSO。这是我的代码:publicstaticICoreService2010GetTridionClient(){varbinding=newBasicHttpBinding(){Name="BasicHttpBinding_TridionCoreService",CloseTimeout=newTimeSpan(0,1,0),OpenTimeout=newTimeSp

c# - npgsql 泄漏 Postgres 数据库连接 : Way to monitor connections?

背景:我正在将我的应用程序从npgsqlv1迁移到npgsqlv2.0.9。运行我的应用程序几分钟后,我收到System.Exception:从池中获取连接时超时。网络声称这是由于连接泄漏(打开数据库连接,但没有正确关闭它们)造成的。所以我正在尝试诊断npgsql中泄漏的postgres连接。来自身边的各种网络文学;诊断泄漏连接的一种方法是在npgsql上设置日志记录,并在日志中查找泄漏连接警告消息。问题是,我在任何地方的日志中都没有看到这条消息。我还找到了监视npgsql连接的实用程序,但它不稳定并且会崩溃。所以我只能手动检查代码。对于创建npgsql连接的每个地方,都有一个fina

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