Solved

Comm. between VC++ & Java

Posted on 1998-07-14
3
161 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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…

696 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