• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in communication bet'n vb client and java server

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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

 
dumukku dumukku
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic