云上简单的基于套接字的服务器
我正在编写一个应用程序来侦听特定端口上的传入连接。客户端是安装在汽车上的 GPS 跟踪设备,服务器目前使用异步套接字在 .NET 中实现。一切工作正常,但我正在考虑将服务器迁移到 Azure 等云服务,以减轻自己照顾随时可能出现故障的硬件的苦差事。
我的问题是:云服务器能否为我提供一个固定的 IP 地址,让我的代码在特定端口上侦听?服务器做的处理很少(一些 NMEA 句子解析),所以我认为在云上托管的成本不会很高。任何提示表示赞赏。
I am writing an application that listens for incoming connections on specific ports. The clients are GPS tracking devices installed on cars and the server is currently implemented in .NET using asynchronous sockets. Everything works fine, but I am thinking of moving the server to a cloud service such as Azure in order to relieve myself of the chore of taking care of the hardware which may fail at any time.
My question is: can the cloud server offer me a fixed IP address on which my code would listen on a specific port? The server does little processing (some NMEA sentence parsing) so I think the cost of hosting on the cloud would not be high. Any hints are appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Windows Azure 中,您将获得一个固定的 DNS 名称,该名称将解析为当前分配的 IP 地址(如果运行多个辅助角色,请记住负载平衡)。
在 Rackspace 云 中,您会获得固定的 IP 地址。在 Amazon EC2 中,您有类似 弹性 IP 的内容
In windows Azure you get a fixed DNS name, which would resolve to the currently assigned IP address (keep in mind Load balancing, if running more than worker role).
In Rackspace cloud you get a fixed IP address. In Amazon EC2 you have something like Elastic IP
您可以固定外部端口号,但如果您创建更多角色实例,IP 地址会有所不同。
You can fix the external port number, but the ip address would vary if you create more instances of the role.