尝试打开 TcpChannel 时出现错误 10048 [英] Error 10048 when trying to open TcpChannel

查看:55
本文介绍了尝试打开 TcpChannel 时出现错误 10048的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在远程处理方面非常缺乏经验.我正在尝试使用它并在打开 TcpChannel 时不断收到 WinSock 错误 10048.

I'm pretty inexperienced in Remoting. I'm trying to use it and keep receiving WinSock error 10048 when opening TcpChannel.

我使用 MSDN 中最简单的代码:

I use the simplest code from MSDN:

    TcpChannel serverChannel = new TcpChannel(9090);
    ChannelServices.RegisterChannel(serverChannel);
    RemotingConfiguration.RegisterWellKnownServiceType(
        typeof(RemoteObject), "RemoteObject.rem", 
        WellKnownObjectMode.Singleton);

第一次运行时,它可以正常工作并退出,但第二次等等我一直收到错误 10048,就像套接字 9090 已经在使用中一样.netstat -a 根本不显示端口 9090,就像它已经关闭一样.

When ran for the first time, it work and quit correctly, but for second and so on I keep receiving error 10048, like socket 9090 is already in use. Netstat -a do not show port 9090 at all, like it was closed already.

我做错了什么?

推荐答案

在问这里之前我已经花了四天时间试图解决这个问题,现在已经有了答案:只是 Windows XP 中的 WinSock 已损坏.

Prior to asking here I've spent four days trying to solve this, and already here's an answer: it's just WinSock in Windows XP was corrupted.

两个简单的 Windows 命令解决了这个问题:

Two simple Windows commands solved the problem:

netsh int ip reset resetlog.txt

netsh int ip reset resetlog.txt

netsh winsock 重置

netsh winsock reset

这篇关于尝试打开 TcpChannel 时出现错误 10048的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆