[Gambas-user] A simple server question

M. Cs. mohareve at ...626...
Fri Sep 27 16:01:03 CEST 2013


Hello, I am trying to write a Gambas frontend for a Java server. I have
written a short class for that purpose:

Static App As SSocket
Public messenger As Socket
Public Sub _new()
 messenger = New Socket As "socket"
 messenger.Connect("localhost", 4444)
End

Public Sub socket_Read()
  Dim sCad As String
  Read #messenger, sCad, Lof(messenger)
  FMain.myscreen.Text = sCad
End

Public Sub Send(s As String)
Write #messenger, s, Len(s)
Flush
End

While it works from Java to Gambas (it displays the incoming messages) I am
not able to send the message towards Java. I try to do that with a button's
click, which then invokes the Send(s As String) method. What am I doing
wrong?

Thanks!

Csaba



More information about the User mailing list