Solved

Comm. between VC++ & Java

Posted on 1998-07-14
3
158 Views
Last Modified: 2010-03-30
Platform : Windows NT 5.0
Language : VC++ 5.0, JDK1.1.6

I want to make a server with JKD1.1.6 and clients with VC++5.0.
Which data types do I have to use for socket comunication between VC++5.0 and JDK1.1.6?

There is no problem on each side.
I tested server  with JKD1.1.6 test client. And client with VC++5.0 test server.

Any idea?
If you have any sample code, please send it with your response.
Thanks in advance.
0
Comment
Question by:lmh99
3 Comments
 
LVL 5

Expert Comment

by:msmolyak
ID: 1226141
Any chance you can use CORBA for your project. There the conversion between language data formats will be handled by the ORB all you will need to do is to write interfaces using C++ and JAVA IDLs.
0
 

Author Comment

by:lmh99
ID: 1226142
Hi, msmolyak!

But this time, I don't want to use CORBA.
I want to make it with pure java and VC++.

I'll wait your kindly response again.
Thanks again.
0
 

Accepted Solution

by:
sulam earned 50 total points
ID: 1226143
If you can't use higher-level network protocols like RPC, RMI or CORBA, you are limited to what TCP and UDP.

On the Windows side this means using winsock or another sockets library (such as the Cygnus Win32 Gnu libraries). On the Java side TCP and UDP are both supported in the java.net packet of course.

Once you're on this path, the data types are simply bytes. However these bytes can be cast into other native types on the C++ side, or produced via one of the factory methods on the Java side. While this is straightforward it's certainly low-level. You have to deal with marshalling your arguments for method calls by hand. None of it is difficult per se, but it is tedious.

A good reference on this topic is Stevens book called _Unix Network Programming_. When it was written sockets was not yet the standard on Windows that it is today, and so while the title refers to Unix it is generally applicable to all TCP/IP programming.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
windows explorer path to command prompt 5 45
xampp tool 12 51
fibonacci ten numbers 4 39
SHA2 certs for IIS AND Java? 2 94
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question