OWNet (Visual Basic)

ownet.vb

  • Don't work with visual basic .net!
  • two implementations
    • the first with Winsock Control (OCX)
    • the second with CSocketMaster (One Class and one Module)
  • Some functions can't have same name like PHP or PYTHON or PERL
    • PHP read->VB read
    • PHP dir -> VB dir
    • PHP presence -> VB presence
    • PHP set -> VB setvalue
    • PHP get -> VB readany (without all flags, we have an private function like PHP get)
  • OWServer Function Constants declared with Public Enum OWNET_READ_TYPES
  • OWNet.VB Error Constants declared with Public Enum OWNET_ERRORS
  • Error Function (LastError()) instead returning NULL values
    • VB read functions are STRING and we can't return NULL

ENUMS:

OWNET_READ_TYPES

  • OWNET_MSG_ERROR = 0
  • OWNET_MSG_NOP = 1
  • OWNET_MSG_READ = 2
  • OWNET_MSG_WRITE = 3
  • OWNET_MSG_DIR = 4
  • OWNET_MSG_SIZE = 5
  • OWNET_MSG_PRESENCE = 6
  • OWNET_MSG_DIR_ALL =7
  • OWNET_MSG_READ_ANY = 99999

OWNET_ERRORS

  • OWNET_ERR_NOERROR = 0
  • OWNET_ERR_CANT_CONNECT = 1
  • OWNET_ERR_READ_ERROR = 2
  • OWNET_ERR_WRITE_ERROR = 3
  • OWNET_ERR_NOREAD_VALUE = 4

PUBLIC VARIABLES:

  • RemoteHost (String)
  • RemotePort (Integer)

FUNCTIONS:

LastError() as OWNET_ERRORS

  • return last error when reading or writing

Dir(Path as String) as String  

  • return directory list with "," separator
  • lasterror() should be used

Presence(Path as String) as Boolean

  • check presence
  • lasterror() shouldn't be used

Read(Path as String) as String

  • read a path
  • lasterror() should be used

ReadAny(Path as String) as String

  • read with Read function, if fail read with Dir function
  • lasterror() should be used

SetHost(Host as String)     

  • set ow server host
  • lasterror() shouldn't be used
  • changing Public Variable RemoteHost is the same thing

SetPort(Port as Integer)     

  • set ow server port
  • lasterror() shouldn't be used
  • changing Public Variable RemotePort is the same thing

GetHost() as String               

  • return ow server host
  • reading Public Variable RemoteHost is the same thing

GetPort() as Integer

  • return ow server port
  • reading Public Variable RemotePort is the same thing

SetValue(Path as String,Value as String) as Boolean

  • set a value
  • return true on success
  • return false on error
  • lasterror() shouldn't be used

When using ownet.vb with csocketmaster constant sckConnectAborted is setted, if you get error comment sckConnectAborted declaration
Roberto Spadim


Previous page: Light - OWNet
Next page: OWNet (python)