Forums Register Login

Problem in communication bet'n vb client and java server

+Pie Number of slices to send: Send
Hi all,
The vb client is successfull in connecting to the server and also sending the data.. I am not getting any error/exception there.the server is not able to receive any data .Only after I close the vb client Application the message sent by the client is seen on the server side..

Please help me in this regards..
thanks in advance
Ravi
Yeh i will write more detail about my code..
We had first designed first the server in java.and the client also in java..As the UI for client doen'nt look nice in Java i shifted to do VB client..
I am using the Winsock control..( VB6 )
I am doing the
winsock.connect
then checking whether the socket is in the sckConnected state or not
If client socket is in the connected state
Then i am sending the data.
The server needs to receive this data(username and password)
Server authenticates the user and send back a string as Authenticcated.
The VB Client needs to receive this data so
IN Vb Client i call the winsock.GetData..
But problem is i am not seeing any message in Java server side
and no message is being sent by server to Vb Client..
But when I close the VB Application..The message on the server side is seen ie.,
the user name and password that Vb client had sent..
pls guide me in this regard
I am attaching the code also
Dim strdata As String
Dim index As Integer
Static intClick As Integer
Dim intClickNumber As Integer
Dim dblEndTime As Double
If frmclient.optconfig = False Then
MsgBox "Enter the Server Name and Port Number in Configure Tab", vbOKOnly, "HostConfigure"
frmlogin.Hide
Exit Sub
End If
If txthostid = "" Or txtpassword = "" Then
MsgBox "Enter the HostId and Password ", vbOKOnly, "HostLogin"
Exit Sub
End If
MsgBox frmclient.tcpclient.State
If frmclient.tcpclient.State <> sckConnected Then
frmclient.tcpclient.Connect
End If
' Each time the button is clicked,
' give it a unique number.
intClick = intClick + 1
intClickNumber = intClick
' Wait for ten seconds.
dblEndTime = Timer + 10#
Do While dblEndTime > Timer
' Do nothing but allow other
' applications to process
' their events.
cmdok.Enabled = False
cmdcancel.Enabled = False
DoEvents
Loop
cmdok.Enabled = True
cmdcancel.Enabled = True
MsgBox frmclient.tcpclient.State
If frmclient.tcpclient.State = sckError Then
MsgBox "Server not ready", vbOKOnly, "TCPError"
Exit Sub
End If
If frmclient.tcpclient.State <> sckConnected Then
MsgBox "Client not connected to Server", vbOKOnly, "TCPError"
Exit Sub
End If
frmclient.tcpclient.SendData ("host3" + "$" + "host3")
frmclient.tcpclient.GetData strdata
txtoutput.Text = strdata
MsgBox strdata
frmlogin.Hide
waiting for ur reply sir,
thanks
Ravi
+Pie Number of slices to send: Send
 

Originally posted by ravi upasi:
Hi all,
The vb client is successfull in connecting to the server and also sending the data.. I am not getting any error/exception there.the server is not able to receive any data .Only after I close the vb client Application the message sent by the client is seen on the server side..

Please help me in this regards..
thanks in advance
Ravi
Yeh i will write more detail about my code..
We had first designed first the server in java.and the client also in java..As the UI for client doen'nt look nice in Java i shifted to do VB client..
I am using the Winsock control..( VB6 )
I am doing the
winsock.connect
then checking whether the socket is in the sckConnected state or not
If client socket is in the connected state
Then i am sending the data.
The server needs to receive this data(username and password)
Server authenticates the user and send back a string as Authenticcated.
The VB Client needs to receive this data so
IN Vb Client i call the winsock.GetData..
But problem is i am not seeing any message in Java server side
and no message is being sent by server to Vb Client..
But when I close the VB Application..The message on the server side is seen ie.,
the user name and password that Vb client had sent..
pls guide me in this regard
I am attaching the code also
Dim strdata As String
Dim index As Integer
Static intClick As Integer
Dim intClickNumber As Integer
Dim dblEndTime As Double
If frmclient.optconfig = False Then
MsgBox "Enter the Server Name and Port Number in Configure Tab", vbOKOnly, "HostConfigure"
frmlogin.Hide
Exit Sub
End If
If txthostid = "" Or txtpassword = "" Then
MsgBox "Enter the HostId and Password ", vbOKOnly, "HostLogin"
Exit Sub
End If
MsgBox frmclient.tcpclient.State
If frmclient.tcpclient.State <> sckConnected Then
frmclient.tcpclient.Connect
End If
' Each time the button is clicked,
' give it a unique number.
intClick = intClick + 1
intClickNumber = intClick
' Wait for ten seconds.
dblEndTime = Timer + 10#
Do While dblEndTime > Timer
' Do nothing but allow other
' applications to process
' their events.
cmdok.Enabled = False
cmdcancel.Enabled = False
DoEvents
Loop
cmdok.Enabled = True
cmdcancel.Enabled = True
MsgBox frmclient.tcpclient.State
If frmclient.tcpclient.State = sckError Then
MsgBox "Server not ready", vbOKOnly, "TCPError"
Exit Sub
End If
If frmclient.tcpclient.State <> sckConnected Then
MsgBox "Client not connected to Server", vbOKOnly, "TCPError"
Exit Sub
End If
frmclient.tcpclient.SendData ("host3" + "$" + "host3")
frmclient.tcpclient.GetData strdata
txtoutput.Text = strdata
MsgBox strdata
frmlogin.Hide
waiting for ur reply sir,
thanks
Ravi

 
+Pie Number of slices to send: Send
Hi ravi,
You have to send data with vbcrlf in vb client side.
example winsock.send "message" & vbcrlf
i have one question about java server how do you handling proxy in sever side pls reply me

Originally posted by ravi upasi:
Hi all,
The vb client is successfull in connecting to the server and also sending the data.. I am not getting any error/exception there.the server is not able to receive any data .Only after I close the vb client Application the message sent by the client is seen on the server side..

Please help me in this regards..
thanks in advance
Ravi
Yeh i will write more detail about my code..
We had first designed first the server in java.and the client also in java..As the UI for client doen'nt look nice in Java i shifted to do VB client..
I am using the Winsock control..( VB6 )
I am doing the
winsock.connect
then checking whether the socket is in the sckConnected state or not
If client socket is in the connected state
Then i am sending the data.
The server needs to receive this data(username and password)
Server authenticates the user and send back a string as Authenticcated.
The VB Client needs to receive this data so
IN Vb Client i call the winsock.GetData..
But problem is i am not seeing any message in Java server side
and no message is being sent by server to Vb Client..
But when I close the VB Application..The message on the server side is seen ie.,
the user name and password that Vb client had sent..
pls guide me in this regard
I am attaching the code also
Dim strdata As String
Dim index As Integer
Static intClick As Integer
Dim intClickNumber As Integer
Dim dblEndTime As Double
If frmclient.optconfig = False Then
MsgBox "Enter the Server Name and Port Number in Configure Tab", vbOKOnly, "HostConfigure"
frmlogin.Hide
Exit Sub
End If
If txthostid = "" Or txtpassword = "" Then
MsgBox "Enter the HostId and Password ", vbOKOnly, "HostLogin"
Exit Sub
End If
MsgBox frmclient.tcpclient.State
If frmclient.tcpclient.State <> sckConnected Then
frmclient.tcpclient.Connect
End If
' Each time the button is clicked,
' give it a unique number.
intClick = intClick + 1
intClickNumber = intClick
' Wait for ten seconds.
dblEndTime = Timer + 10#
Do While dblEndTime > Timer
' Do nothing but allow other
' applications to process
' their events.
cmdok.Enabled = False
cmdcancel.Enabled = False
DoEvents
Loop
cmdok.Enabled = True
cmdcancel.Enabled = True
MsgBox frmclient.tcpclient.State
If frmclient.tcpclient.State = sckError Then
MsgBox "Server not ready", vbOKOnly, "TCPError"
Exit Sub
End If
If frmclient.tcpclient.State <> sckConnected Then
MsgBox "Client not connected to Server", vbOKOnly, "TCPError"
Exit Sub
End If
frmclient.tcpclient.SendData ("host3" + "$" + "host3")
frmclient.tcpclient.GetData strdata
txtoutput.Text = strdata
MsgBox strdata
frmlogin.Hide
waiting for ur reply sir,
thanks
Ravi

 
+Pie Number of slices to send: Send
Hello 2 all,

Bt may i know JAVA server code with this VB client I am unable to read data from VB client. So if it is working with this code then do let me know..

thanx

Jignesh
ji2nesh@gmail.com
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 3108 times.
Similar Threads
This is a real Challenge ....
problem with connecting vb client to java server
raw xml as the payload
socket programming with SERVER in VB and CLient in JAVA ???
Socket Sending and Recieving at same Time?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:06:27.