Re: communication between vb and java

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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 still
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
client
using the control in VB6.0: Winsock calls "Winsock1.connect" function to
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
,then
the problem come up:VB prompt up a box saying:"Run-time error: '40006'
Wrong
protocol or connection state for the requested transaction or
request".And
I
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




.



Relevant Pages

  • Re: breaking the model
    ... > The forms data then is in the Request object. ... HTTP Request; in this case, the form POST Request from the Page. ... client and server. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Resolving record with enumerated type
    ... In a CPU BFM package, ... because data goes in two directions (request from the ... from the server to the client), you'll need some way to orchestrate ...
    (comp.lang.vhdl)
  • Re: NadaNet file server coming soon...
    ... Applesoft BASIC running under ProDOS, in less than 300 lines, ... After each command is completed by the server, ... client the result code, the AUX TYPE, ... forgoes queueing (since one client can't have more than one request ...
    (comp.sys.apple2)
  • Re: Kerberos with Windows Integrated authentication
    ... behaviour if your Web server is in the client broweser's Internet zone. ... referencing it by computer name rather than FQDN), the browser will request ... Obviously, if you want to use Kerberos for authentication, you will either ...
    (microsoft.public.windows.server.security)
  • Re: Performance Issue with Runtime Image
    ... >> the client, closes the connection, then dies. ... request before even accepting the next incoming connection. ... The client program is unaffected so presumably the server is ...
    (comp.lang.smalltalk.dolphin)