Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private Sock As Socket
Private AsyncSock As AsyncStreams
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
Dim in As InputStream = File.OpenInput(File.DirAssets, "Entrada-keystore.p12")
Sock.InitializeSSL("Sock", in, "Born to be wild")
setprotocol
' Sock.Initialize("Sock")
Sock.Connect("192.168.1.205", 10001, 5000)
End Sub
private Sub Sock_Connected (Successful As Boolean)
If Successful = True Then
Log("Whe have Connection")
Else
Log("Something Wrong with connection")
End If
End Sub
Private Sub setprotocol
Dim r As Reflector
r.Target = Sock 'socket variable
r.Target = r.GetField("socket")
r.RunMethod4("setEnabledProtocols", Array(Array As String("TLSv1.1", "SSLv3")), _
Array As String("[Ljava.lang.String;"))
End Sub