【问题标题】:Retrieving packet data from web server从 Web 服务器检索数据包数据
【发布时间】:2013-12-09 09:16:19
【问题描述】:

我需要捕获一些由 GPRS 模块发送到特定 IP 网络服务器的数据包数据。我正在使用 REST Web 服务来捕获数据包数据。我是新手,所以请原谅我的愚蠢;我的疑问是,我们是否可以使用@GET 注释直接将数据包数据访问到字符串,或者我应该在@GET 注释中定义一个服务器套接字函数然后收听它?

【问题讨论】:

    标签: web-services sockets rest jakarta-ee


    【解决方案1】:

    我认为我们应该在@GET 注释中提供服务器套接字功能。 喜欢;

    @GET
    @Path("/hello/path")
    public String hello(@PathParam("path") String val) {
    ServerSocket server = new ServerSocket(6608);
    Socket socket = null;
    socket = phone.accept();
    InputStream in = socket.getInputStream();
    din = new DataInputStream(in);
    
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-03-15
      • 1970-01-01
      • 1970-01-01
      • 2019-12-05
      • 1970-01-01
      • 1970-01-01
      • 2015-06-25
      • 1970-01-01
      相关资源
      最近更新 更多