有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!


共 (1) 个答案

  1. # 1 楼答案

    你几乎做到了,伙计,你愿意拥有聊天应用程序,可以从android、IOS、桌面应用程序和web浏览器进行操作,因此正如你所说,你使用了JAVA socket服务器程序,目前主要基于桌面,正如你所说,你正在使用原始socket编程,这对移动&;桌面应用程序,但是web应用程序呢?是的,在那种情况下不可能

    因此,为了让今天所有可用的小工具都能实现这一点,包括智能手机、智能手表、使用web浏览器和桌面应用程序,你必须使用WebSocket

    WebSocket is a protocol providing full-duplex communication channels over a single TCP connection. The WebSocket protocol was standardized by the IETF as RFC 6455 in 2011, and the WebSocket API in Web IDL is being standardized by the W3C.

    您可以从这里了解一些WebSocket:

    websocket.org

    socket.io

    So here comes a concept of WebSockets, using which you can achieve almost what you are supposed to do. So you can do few things out of following to achieve this:

    1. 您可以修改现有的JAVA程序来处理WebSocket连接,而不是处理原始套接字,您目前正在这样做

    2. 另一种可能性是可以用Python或node编写服务器WS(WebSocket)程序。JS,它很容易开发,并且托管在任何免费的云服务上,比如herokuopenshift甚至AWS

    So, in this case once you created/modified your existing server program to WS, all you have to do is create client side programs in either or all of the following:

    1. IOS app
    2. Android APP
    3. Desktop App(In .NET or JAVA or Python)
    4. Website in PHP or Python(Using JavaScript WS client libraries)

    您可以在上述任何或所有平台中创建客户端程序,WS-client库几乎可用于上述所有平台

    所以,一旦您使用服务器端,您就可以在openshift上托管您的服务器端程序,它可以免费使用PaSS云服务,远远优于目前可用的其他PaSS服务