首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法在127.0.0.1端口555上打开TCP通道(SocketException:不知道此类主机)

无法在127.0.0.1端口555上打开TCP通道(SocketException:不知道此类主机)
EN

Stack Overflow用户
提问于 2016-02-25 09:21:46
回答 1查看 1.5K关注 0票数 2

我在127.0.0.1端口555上运行了大约两年的Quartz调度程序Windows服务。从几天前开始,我再也不能开始我的服务了。当我查看代码时,我发现我无法启动TcpChannel对象。

代码语言:javascript
运行
复制
IChannel chan;
chan = new TcpChannel(props, null, formatprovider);

当我在cmd上执行netstat时,我在侦听或建立地址中都找不到地址。在我的防火墙上,我也找不到任何与这个端口有关的新规则。

该服务基于Quartz.net调度程序。

服务日志:

代码语言:javascript
运行
复制
2016-02-25 10:19:58,847 [9] INFO  Quartz.Impl.StdSchedulerFactory [(null)] - Quartz.NET properties loaded from configuration file 'C:\Users\pedram.mobedi\Documents\GitHub\Postbag\build\Debug\quartz.config'
2016-02-25 10:19:58,958 [9] INFO  Quartz.Util.DBConnectionManager [(null)] - Registering datasource 'default' with db provider: 'Quartz.Impl.AdoJobStore.Common.DbProvider'
2016-02-25 10:19:58,965 [9] INFO  Quartz.Impl.StdSchedulerFactory [(null)] - Using default implementation for object serializer
2016-02-25 10:19:58,996 [9] INFO  Quartz.Impl.StdSchedulerFactory [(null)] - Using custom data access locking (synchronization): Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore
2016-02-25 10:19:59,002 [9] INFO  Quartz.Impl.StdSchedulerFactory [(null)] - Using default implementation for ThreadExecutor
2016-02-25 10:19:59,099 [9] INFO  Quartz.Core.SchedulerSignalerImpl [(null)] - Initialized Scheduler Signaller of type: Quartz.Core.SchedulerSignalerImpl
2016-02-25 10:19:59,107 [9] INFO  Quartz.Core.QuartzScheduler [(null)] - Quartz Scheduler v.2.2.4.400 created.
2016-02-25 10:19:59,128 [9] INFO  Quartz.Impl.AdoJobStore.JobStoreTX [(null)] - JobStoreTX initialized.
2016-02-25 10:19:59,263 [9] INFO  Quartz.Core.QuartzScheduler [(null)] - Scheduler QuartzScheduler_$_NON_CLUSTERED shutting down.
2016-02-25 10:19:59,270 [9] INFO  Quartz.Core.QuartzScheduler [(null)] - Scheduler QuartzScheduler_$_NON_CLUSTERED paused.
2016-02-25 10:19:59,287 [9] INFO  Quartz.Core.QuartzScheduler [(null)] - Scheduler QuartzScheduler_$_NON_CLUSTERED Shutdown complete.
2016-02-25 10:19:59,321 [9] ERROR Quartz.Server.QuartzServer [(null)] - Server initialization failed:Unable to bind scheduler to remoting.
Quartz.SchedulerException: Unable to bind scheduler to remoting. ---> System.Net.Sockets.SocketException: No such host is known
   at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
   at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
   at System.Runtime.Remoting.Channels.CoreChannel.GetMachineIp()
   at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.SetupMachineName()
   at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(IDictionary properties, IServerChannelSinkProvider sinkProvider, IAuthorizeRemotingConnection authorizeCallback)
   at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(IDictionary properties, IServerChannelSinkProvider sinkProvider)
   at System.Runtime.Remoting.Channels.Tcp.TcpChannel..ctor(IDictionary properties, IClientChannelSinkProvider clientSinkProvider, IServerChannelSinkProvider serverSinkProvider)
   at Quartz.Simpl.RemotingSchedulerExporter.RegisterRemotingChannelIfNeeded() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Simpl\RemotingSchedulerExporter.cs:line 120
   at Quartz.Simpl.RemotingSchedulerExporter.Bind(IRemotableQuartzScheduler scheduler) in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Simpl\RemotingSchedulerExporter.cs:line 71
   at Quartz.Core.QuartzScheduler.Bind() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Core\QuartzScheduler.cs:line 375
   at Quartz.Core.QuartzScheduler.Initialize() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Core\QuartzScheduler.cs:line 352
   --- End of inner exception stack trace ---
   at Quartz.Core.QuartzScheduler.Initialize() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Core\QuartzScheduler.cs:line 366
   at Quartz.Impl.StdSchedulerFactory.Instantiate() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Impl\StdSchedulerFactory.cs:line 1046
   at Quartz.Impl.StdSchedulerFactory.GetScheduler() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Impl\StdSchedulerFactory.cs:line 1120
   at Quartz.Server.QuartzServer.GetScheduler() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\server\Quartz.Server\QuartzServer.cs:line 62
   at Quartz.Server.QuartzServer.Initialize() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\server\Quartz.Server\QuartzServer.cs:line 47 [See nested exception: System.Net.Sockets.SocketException (0x80004005): No such host is known
   at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
   at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
   at System.Runtime.Remoting.Channels.CoreChannel.GetMachineIp()
   at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.SetupMachineName()
   at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(IDictionary properties, IServerChannelSinkProvider sinkProvider, IAuthorizeRemotingConnection authorizeCallback)
   at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(IDictionary properties, IServerChannelSinkProvider sinkProvider)
   at System.Runtime.Remoting.Channels.Tcp.TcpChannel..ctor(IDictionary properties, IClientChannelSinkProvider clientSinkProvider, IServerChannelSinkProvider serverSinkProvider)
   at Quartz.Simpl.RemotingSchedulerExporter.RegisterRemotingChannelIfNeeded() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Simpl\RemotingSchedulerExporter.cs:line 120
   at Quartz.Simpl.RemotingSchedulerExporter.Bind(IRemotableQuartzScheduler scheduler) in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Simpl\RemotingSchedulerExporter.cs:line 71
   at Quartz.Core.QuartzScheduler.Bind() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Core\QuartzScheduler.cs:line 375
   at Quartz.Core.QuartzScheduler.Initialize() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Core\QuartzScheduler.cs:line 352]

更新:主机文件

代码语言:javascript
运行
复制
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost

127.0.0.1       localhost

更新2:quartz.config

代码语言:javascript
运行
复制
# Quartz Config

quartz.threadPool.type = Quartz.Simpl.SimpleThreadPool, Quartz
quartz.threadPool.threadCount = 10
#quartz.threadPool.threadPriority = Normal

# Settings for using Quartz as a windows service
quartz.scheduler.exporter.type = Quartz.Simpl.RemotingSchedulerExporter, Quartz
quartz.scheduler.exporter.port = 555
quartz.scheduler.exporter.bindName = Postbag
quartz.scheduler.exporter.channelType = tcp
quartz.scheduler.exporter.channelName = httpQuartz

# SQLite settings
quartz.jobStore.type = Quartz.Impl.AdoJobStore.JobStoreTX, Quartz
quartz.jobStore.misfireThreshold = 60000
quartz.jobStore.lockHandler.type = Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz
quartz.jobStore.useProperties = true
quartz.jobStore.dataSource = default
quartz.jobStore.tablePrefix = qrtz_
quartz.jobStore.driverDelegateType = Quartz.Impl.AdoJobStore.SQLiteDelegate, Quartz
quartz.dataSource.default.provider = SQLite-10
quartz.dataSource.default.connectionString = Data Source=.\jobs.db;Version=3
EN

回答 1

Stack Overflow用户

发布于 2016-02-25 10:27:00

这意味着您绑定了一个不存在的主机名。也许你可以把它指向另一个地点。

1、你修改过防火墙规则吗?可能是您阻止了您的程序,或者您阻止了对127.0.0.1的所有访问

你的主机名是域名吗?如果是,这意味着域不再指向此机器。您应该将其重新指向主机文件中:

按Win+R,输入以下命令:

代码语言:javascript
运行
复制
notepad.exe %windir%\system32\drivers\etc\hosts

然后,您可以检查域是否已经在该文件中。如果是,并以"#“开头,则删除"#”。如果没有,请输入以下内容:

代码语言:javascript
运行
复制
127.0.0.1 [your domain name]

例如:

代码语言:javascript
运行
复制
127.0.0.1 test.cn

3 .如果主机名为"127.0.0.1",则不应发生这种情况。这可能是您的操作系统的错误。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35623041

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档