This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes problem with connecting vb client to java server 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 "problem with connecting vb client to java server" Watch "problem with connecting vb client to java server" New topic
Author

problem with connecting vb client to java server

willsion lim
Greenhorn

Joined: Feb 01, 2009
Posts: 3
I have some problem when writing a java server to receive data from vb client.

on the java side i use socket to listen

public class myServer extends Thread{
private Socket client;
public myServer(Socket c){
this.client=c;
}

public void run(){
String host;
String ipAddr;
try{

ipAddr = client.getInetAddress().getHostAddress();

System.out.println("connection from "+ipAddr+" ");

DataInputStream input = new DataInputStream(new BufferedInputStream(client.getInputStream()));
DataOutputStream output = new DataOutputStream(new BufferedOutputStream(client.getOutputStream()));
.............
===============================================================
on the vb side, i define tcpClient like

Dim tcpclient As New System.Net.Sockets.TcpClient();
Try
tcpclient.Connect(iAdd,iPort) <----the client send a blank message to server at here, and my server treat it as the message expected,
then the rest of the vb codes do nothing and hang there..
Dim networkStream As NetworkStream = tcpClient.GetStream();
........

i am a newbie in java network programming, so i still cannot find the error
Can anyone give me any reason about this kind of problem? thanks
willsion lim
Greenhorn

Joined: Feb 01, 2009
Posts: 3
i figure out the problem.

i use .available() to estimate the inputstream, some times it will return 0 depends on web condition.

 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: problem with connecting vb client to java server
 
jQuery in Action, 3rd edition