[英]Is it possible to read incoming data stream, using java, from Server to .exe client (Coded using C++)?
Is it possible to read datastream sent from C++ server program to C++ client over socket connection in java? 是否可以通过Java中的套接字连接读取从C ++服务器程序发送到C ++客户端的数据流? I have details like port number and server IP.
我有端口号和服务器IP之类的详细信息。
Or do I need decompile the whole C++ client into Assembly and then somehow translate it into java to do that? 还是我需要将整个C ++客户端反编译为Assembly,然后以某种方式将其转换为Java来做到这一点?
I'm really not sure what kind of data it's transforming, though.. Somebody told me to code HTTP server and run it on my Router but I'm not really sure if that would work? 不过,我真的不确定要转换哪种数据。有人告诉我对HTTP服务器进行编码,然后在路由器上运行它,但我不确定这是否可行?
Here's the diagrammatic way to look at it. 这是查看它的图解方法。
Server generates data.
it puts it in a packet.
it encrypts the packet.
and sends it over the wire.
It gets to a user’s Computer (= client). (I should be in the control now on..)
(If I could somehow read data at this part?)
The client reads the encrypted packet.
(If I could somehow read data at this part?) (The later, the better :D)
The client decrypts the packet.
(If I could somehow read data at this part?) (The later, the better :D)
The client does something.
As said, the client is .exe file and it's coded using C++. 如前所述,客户端是.exe文件,并且使用C ++进行编码。 And I don't have source code of it.
而且我没有它的源代码。
All you have to do is define well your application protocol. 您要做的就是很好地定义您的应用程序协议。 This is, the format of your data stream.
这就是数据流的格式。 As long as you are using the same format in both ends, it doesn't really matter what language or program you are using.
只要您在两端使用相同的格式,使用什么语言或程序就没有关系。 Imagine your browser and the web server.
想象一下您的浏览器和Web服务器。 They are both using the same application protocol (HTTP) but they are completely different programs.
它们都使用相同的应用程序协议(HTTP),但它们是完全不同的程序。 Even more, there exists different web servers and different browsers.
甚至存在不同的Web服务器和不同的浏览器。
Then, all you need to do is use the java sockets to listen to some specific port, and use your c++ sockets to write to the specific port. 然后,您需要做的就是使用java套接字监听某些特定端口,并使用c ++套接字写入特定端口。 Just make sure you know how the information is "organized".
只要确保您知道信息是如何“组织”的即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.