|
-
Aug 8th, 2009, 04:19 PM
#1
Thread Starter
Fanatic Member
java receive data from visual basic 6.0
i made a server in java and now when i send data from visual basic, nothing happens because i have no method to receive the data and i would like to get one. i tried google and found nothing.
how to receive data in java from vb?
-
Aug 8th, 2009, 05:42 PM
#2
Re: java receive data from visual basic 6.0
How are you sending the data and how are you attempting to receive it?
Are both the programs running on the same server? I assume not since you mention you're using java on your server. You may want to look into web services.
-
Aug 8th, 2009, 07:38 PM
#3
Thread Starter
Fanatic Member
Re: java receive data from visual basic 6.0
the server is programmed in java, i send data from vb6 with winsock by using a code like this: winsock1.sendData(data)
and i want the server to read the data and print it to the console.
-
Aug 9th, 2009, 04:35 PM
#4
Re: java receive data from visual basic 6.0
use Server Sockets.. There are lots of tutorials online. Just google the topic
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Aug 10th, 2009, 08:08 AM
#5
Thread Starter
Fanatic Member
Re: java receive data from visual basic 6.0
incase you didnt read what i wrote: "i tried google"
-
Aug 10th, 2009, 08:35 AM
#6
Re: java receive data from visual basic 6.0
So you've seen these results and non of them works for you
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Aug 11th, 2009, 02:01 PM
#7
Thread Starter
Fanatic Member
Re: java receive data from visual basic 6.0
i quit searching for this now, google wont show the same results up for every computer.
everything i want is just to get the message from the client.
-
Aug 11th, 2009, 03:17 PM
#8
Re: java receive data from visual basic 6.0
Ok, this code should work. I haven't tried it and I'm not sure if it's exactly what you need.
Code:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ServerSocket;
public class Test {
public static void main(final String[] args) throws IOException {
final ServerSocket serverSocket = new ServerSocket(1234);
serverSocket.setReceiveBufferSize(1024 * 8);
final BufferedReader reader = new BufferedReader(new InputStreamReader(
serverSocket.accept().getInputStream()));
final StringBuffer buffer = new StringBuffer();
while (reader.ready())
buffer.append(reader.readLine() + "\n");
System.out.println(buffer.toString());
}
}
But I still hope its useful
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Aug 12th, 2009, 11:37 AM
#9
Thread Starter
Fanatic Member
Re: java receive data from visual basic 6.0
not sure, when i connect to it, the program stops running and says "press a key to continue..." or something like that and stops running.
-
Aug 12th, 2009, 12:21 PM
#10
Re: java receive data from visual basic 6.0
I forgot to mention that 1234 is the port number. Feel free to change it to whatever appropriate.
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Aug 12th, 2009, 04:00 PM
#11
Thread Starter
Fanatic Member
Re: java receive data from visual basic 6.0
i know that... i changed the port to the one i want to and when i connect to the server with my client, the server stops running.
-
Sep 16th, 2009, 05:10 AM
#12
New Member
Re: java receive data from visual basic 6.0
Hello budy..
i have one suggestion for this situation, u should write send method from server which is coded in java and write get method at client side which is coded in VB language, yet i have never tried it but just find more solution from www.sun.com, if any problem occure.
-
Oct 6th, 2009, 04:02 PM
#13
Thread Starter
Fanatic Member
Re: java receive data from visual basic 6.0
good idea... almost gave up hope making this...
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|