File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes Java VB communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Java VB communication" Watch "Java VB communication" New topic

Java VB communication

Russell Anam

Joined: Nov 15, 2001
Posts: 7
I have a system, where my VB program sends strings to a Java server. Now I have been using BufferedInputStream to read character form the socket. But I want to read the whole string sent my the VB program. How can I read the complete string sent by VB? I need something like DataInputStream which works perfectly for Java to Java communication. Currently, I send a special character after each string (in the VB program) so when the Java server get that charater it understands that a string has been completed. Now what I am thinking it that it won't work when multi machines are sending data to the same port. The java program might now get all charaters serially from the same PC. SO I need to get the whole string sent by the VB program. Any suggestions?
dan moore
Ranch Hand

Joined: Nov 04, 2001
Posts: 68
hi Russell,
i've read your msg a few times and am still quite confused... are you worried that if many connections are made to the port you are listening on, that the incoming data will become interleaved and corrupted?
if that is your fear, i think it is unfounded - although multiple (in your case, VB) clients share the same (java) server port they get individual socket connections. each socket connects one (VB) client and one (java) server. if you want to cope with multiple clients, you have to accept one socket connection for each client.
otherwise, you may have to explain a bit further (for me!).
hope that helps,
cheers, dan.

dan moore, infomatiq ltd.<br />email<br /><a href="" target="_blank" rel="nofollow"></a>
Russell Anam

Joined: Nov 15, 2001
Posts: 7
How stupid of me!!! Thank you very much. I can just have the same port but different sockets for each connection. They will never get mixed up. Thanks Dan!!!
[This message has been edited by Russell Anam (edited November 15, 2001).]
I agree. Here's the link:
subject: Java VB communication
jQuery in Action, 3rd edition