Java and C++ do not talk over UDP
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? (Except firewall and wrong ports?)
Here some more Details:
I tried Winsock as well as WinSock2.
and socket(AF_INET, SOCK_DGRAM, 0);
socket.connect(address, DAYTIMEPORT );
byte buf = new byte[DGRAM_BUF_LEN];
DatagramPacket packet = new DatagramPacket(buf, buf.length );
Can anybody help me out?
Just to clarify. These client/server pairs are doing exactly the same (possibly meaningless) thing but doing it just fine as long as it's within the same platform. If you swap either the client or the server for it's other language doppleganger then the conversation stops happening. Right?
I reduced the problem to small demo programs. Both are running on windows and you are right .. as long as java talks to java everything is fine .. and c++ to c++ as well. But talkting to each other .. no packages are exchanged.
Very strange ...
That is odd. I'm buffaloed. Have you tried them with TCP instead if UDP? Wow, there should be no architectural dependencies on the two ends of a network conversation.
Are you testing this on one machine, or on two over the network?
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center