在有限资源上开发服务器的最合适方法
我面临着一个似乎没有什么特别简单的解决方案的问题。 进入正题;我在 Windows 上使用 C++ 编写了一个客户端应用程序。 该客户端应用程序接受用户的输入,并应该发送此 信息发送到服务器,服务器找到输入相互匹配的用户 - 就像匹配一样。
我(独立开发者)怎样才能最轻松地解决这个问题,当且仅当我 无法自己托管服务器应用程序,并且不想花钱租用 整个虚拟专用服务器?
最喜欢的是,我想使用 PHP 中的套接字编写这个服务器,然后租一个 具有无限带宽的网络服务器,但它似乎有太多限制, 与超时相关(PHP的set_time_limit、Apache的超时值和内部操作系统 超时值)。
总结一下这个问题,并以通用的形式;作为一名独立开发者我该如何创造 一个服务器应用程序,不需要使用我自己的带宽,也不需要昂贵的购买虚拟专用服务器等项目。
I am facing a problem which seems to have few, and especially simple solutions.
To get to the point; I have written a client application on Windows using C++.
This client application takes input from the user, and is supposed to send this
information to a server, which find users who's inputs match each other - like matchmaking.
How can I (an indie developer) with most ease solve this problem, IF and only if I
cannot host the server application myself, and do not want to spend money on renting
a whole virtual private server?
Most preferred, I want to write this server using sockets in PHP and just rent a
web-server with unlimited bandwidth, but it seems to have far too many restrictions,
related to timeouts (PHP's set_time_limit, Apache's timeout value and the internal OS
timeout value).
So to sum up the question, and in a generic form; How can I as an indie developer create
a server application which do not require using my own bandwidth and without expensive purchases for items such as a virtual private server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您只需使用 PHP 将服务器应用程序编码为网络服务。
在您的客户端应用程序中,您只需使用您创建的 HTTP REST Web 服务,而不是通过套接字和使用自制协议进行连接。在我看来,这比编写整个服务器更容易。
也许您绝对想在服务器上使用套接字,但您没有在问题中指定这一点。
You can just code your server application in PHP as a webservice.
In your client application, instead of connecting through sockets and a using a home-made protocol, you just have to use the HTTP REST webservice you created. It seems to me even easier than coding a whole server.
Maybe you absolutely want to use socket on your server, but you didn't specify that in your question.
您可以尝试云托管提供商,例如 Rackspace。
You can try a cloud hosting provider, such as Rackspace.