Re: communication between vb and java
- From: "Adrian Chen" <aoopopopo@xxxxxxx>
- Date: Sun, 17 Aug 2008 20:04:23 +0800
Thank you,
Thanks Schmidt,my client and server could connect to each other,but another
problem came up:
In client,data is sent by calling the Winsock's
function,i.e.:Winsock1.SendData "YES".
In server,java program receive data as following:
clientReceive=new BufferedReader(new
InputStreamReader(mySocket.getInputStream()));
String newline=clientReceive.readLine();
But the server gets nothing until closing the tcp connection between the
client and server.
Please advice.Thanks a lot!
"Schmidt" <sss@xxxxxxxxx> дÈëÏûÏ¢ÐÂÎÅ:eZJ1qx5$IHA.3396@xxxxxxxxxxxxxxxxxxxxxxx
"Adrian Chen" <aoopopopo@xxxxxxx> schrieb im Newsbeitrag
news:%23Ra3h74$IHA.4032@xxxxxxxxxxxxxxxxxxxxxxx
Hi everybody,I am strugglling with a problem for a whole day,but stillclient
cannot resolve it.Please give me some suggestion.
I want a client (written by VB6.0) to communication with a
server(written
by JAVA).In the debug mode, in the server side ,the server call the java
function "accept()" to block and wait any request from client.Then a
using the control in VB6.0: Winsock calls "Winsock1.connect" function to,then
connect to the server side .And indeed the server receive the request and
programming point(under debug mode) move to next line.And the client go
on
to next statement: Winsock1.Senddata str to send the string to server
the problem come up:VB prompt up a box saying:"Run-time error: '40006'Wrong
protocol or connection state for the requested transaction orI
request".And
check the value of the property "Winsock1.state" is 6(SckConnecting).
Then maybe your breakpoint at the serverside Java-Code
suppresses the socket-connect-attempt (not entirely
accepted and finished) at the server-end. That's why
your VB6-socketstate probably remains in the
'connecting'-state - maybe your debugging works
a bit more reliable, if you set your server-breakpoint
somewhat later, after the socket-request is fully
accepted, so that the VB-clientside-socket can enter
its 'connected'-state. Then you should be able, to
watch or step through the packet-oriented roundtrip,
since this socketstate (a fully established connection)
is "more robust".
Olaf
.
- Follow-Ups:
- Re: communication between vb and java
- From: Schmidt
- Re: communication between vb and java
- References:
- communication between vb and java
- From: Adrian Chen
- Re: communication between vb and java
- From: Schmidt
- communication between vb and java
- Prev by Date: Re: Rounding error using vbContainerSize
- Next by Date: Re: communication between vb and java
- Previous by thread: Re: communication between vb and java
- Next by thread: Re: communication between vb and java
- Index(es):
Relevant Pages
|