简体   繁体   English

是否可以使用Java从Server到.exe客户端(使用C ++编码)读取传入的数据流?

[英]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.

相关问题 可以使用java读取来电吗? - It's possible to read an incoming call using java? 无法从Java服务器使用Boost C ++客户端读取 - Cant read with a boost C++ client from a java server 使用Java中的套接字编程将数据流从客户端程序(在VM中运行)发送到服务器程序(在Host OS上) - Send stream of Data from client program (running in VM) to server program(on Host OS) using socket programming in Java 从Java服务器向C ++客户端发送数据时发生NullPointerException - NullPointerException while sending data from java server to c++ client 是否可以仅从使用 Java 流的集合中获取特定数据? - Is it possible to get specific data only from a collection using Java stream? 在Java客户端中创建Mat对象,使用opencv从C ++服务器发送该对象 - Create Mat object in a Java client, sent from a C++ server using opencv 是否可以使用TCP套接字将JSON数据从Java服务器发送到Android客户端 - Is it possible to send json data from java server to android client using TCP sockets 无法使用PHP客户端从Java套接字服务器读取响应 - Cannot read response from Java socket server using PHP client Java(客户端)和 C#(服务器)TCP 套接字。 和服务器从客户端读取无限的最后数据 - Java(client) and C#(Server) TCP Socket. and Server read infinite last data from client 使用相同的网络流和套接字连接从C#客户端向Java服务器发送多个byte []时挂起 - Hanging when sending multiple byte[] from a C# client to a Java server using the same Network Stream and Socket connection
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM