[java] connect javaprogram with c++ program

Started by
3 comments, last by WoX 21 years, 9 months ago
Is it possible to have a java program on a server and then connect to it from within a C++ program? I wanna have a serverprogram that can write and read to/from a SQL database, that seems possible, but I also wanna connect to that serverprogram from a C++ client that uses winsock2.
Advertisement
Yes. You can connect any two sockets that use the same protocols one to the other regardless of their origin (language, OS, architecture). The InterNet wouldn''t work otherwise.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Heh yea, then I got it confirmed, I do ask stupid questions sometimes
It''s not a totally stupid question. Also there any issue with big endian/little endian ordering from Java based apps to win32 based apps and visa versa. That would probably fall under protocol though.
You have to convert the endianness (whoa, a new word) on your own. That''s why the Win32 API has hton and ntoh to convert integers from host to network and from network to host.

Java seems to take care of that
"Linux is not about free software, it is about community," -- Steve Balmer, Microsoft Chief Executive.

This topic is closed to new replies.

Advertisement