Currently I'm stuck on a very simple UDP communication protocol between a Windows MFC (VC++) application and a Java application.
I have a Java Server and a Java Client .. they communicate perfectly with each other.
The same on the C++ Side. Client and Server talk for hours with each other about lots of nonsense. ( currently about the meaning of life and 42 I think ;-) )
Only when I try to let any java program communicate with it's c++ counterpart - it fails !
Are there any additional "feature" I have to consider?
Here some more Details:
C++ part:
I tried Winsock as well as WinSock2.
with WSAStartup(..) and socket(AF_INET, SOCK_DGRAM, 0);
Java part:
something with...
socket.connect(address, DAYTIMEPORT ); byte[] buf = new byte[DGRAM_BUF_LEN]; DatagramPacket packet = new DatagramPacket(buf, buf.length ); socket.send(packet); socket.receive(packet);
I will need to write an application in Java, which will communicate to 2 other applications (already) written in C++. My Java application basically "sits" between these 2 application, translating messages coming from one machine and forwarding it to the other machine.
I hope someone would provide an answer, and also to my question in the above link.
Willie McGee wrote:what is the actual error you get?
I've same problem,my case it send a buffer 1024 bytes in Java for UDP and received I've supposed 1024 in C but this application "C" says "Error UDP frame too smaill: 1024" I don't know that to do bad. My code is:
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: UDP communication between C++ and Java does not work