由于目标计算机积极拒绝无法连接

小小小小叶 2015-08-05 08:26:58
未处理System.Net.Sockets.SocketException
HResult=-2147467259
Message=由于目标计算机积极拒绝,无法连接。 192.168.1.104:9527
Source=System
ErrorCode=10061
NativeErrorCode=10061
StackTrace:
在 System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
在 System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
在 Sever.Form1.button1_Click(Object sender, EventArgs e) 位置 c:\Users\Administrator\Documents\Visual Studio 2012\Projects\服务器\Sever\Form1.cs:行号 260
在 System.Windows.Forms.Control.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
在 System.Windows.Forms.Button.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.Run(Form mainForm)
在 Sever.Program.Main() 位置 c:\Users\Administrator\Documents\Visual Studio 2012\Projects\服务器\Sever\Program.cs:行号 19
在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException:
请问大神,这是什么鬼,什么原因啊,我用个连个端口接收数据,但是用同样的socket方法,在第二次连接是就出问题看
...全文
12652 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
宝_爸 2015-08-06
  • 打赏
  • 举报
回复
这种错误一般是网络连接不上。
threenewbee 2015-08-05
  • 打赏
  • 举报
回复
防火墙的可能性大。
小小小小叶 2015-08-05
  • 打赏
  • 举报
回复
引用 1 楼 guwei4037 的回复:
socket请求的另一端已经退出,不再提供socket服务,会出现这种异常。检查一下是否退出服务了。
问题解决了,谢谢大神
全栈极简 2015-08-05
  • 打赏
  • 举报
回复
socket请求的另一端已经退出,不再提供socket服务,会出现这种异常。检查一下是否退出服务了。

110,530

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧