If Starter.ClassChecker1.ClassExist("anywheresoftware.b4a.objects.SocketWrapper.ServerSocketWrapper") Then
Dim jo As JavaObject
jo.InitializeNewInstance("anywheresoftware.b4a.objects.SocketWrapper.ServerSocketWrapper", Null)
jo.RunMethod("Initialize", Array(port, "eventname")) '<--This will be "_initialize" instead of "Initialize" for certain objects. You'll have to check.
'do more stuff
'if you have to return a ServerSocket from a public method, return it as an Object
End If