Archived

This topic is now archived and is closed to further replies.

[java] connect javaprogram with c++ program

This topic is 5645 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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 ]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites