Skip to content
This repository has been archived by the owner on Feb 5, 2021. It is now read-only.
LionNatsu edited this page Jul 6, 2014 · 1 revision

Welcome to the CLionet wiki!

Functions

Starting Up & Cleaning Up (STATIC)

declare static function startup() as integer
declare static function cleanup() as integer

Debuging Error (STATIC)

declare static function error() as integer
#ifdef UNICODE
    declare static function error_string() as wstring ptr
  #else
    declare static function error_string() as zstring ptr
#endif

Creating & Closing A Socket Manually

declare virtual function opensocket() as integer
declare virtual function closesocket() as integer

Connecting

declare virtual function connect( addr as string, port as ushort ) as integer
declare virtual function connect( addr as uinteger, port as ushort ) as integer

Examples:
obj.connect( "93.184.216.119", 80 )
obj.connect( 1572395127, 80 )

Binding & Listening

declare virtual function bind( port as ushort ) as integer
declare virtual function bind( addr as string, port as ushort ) as integer
declare virtual function bind( addr as uinteger, port as ushort ) as integer
declare virtual function listen() as integer

declare virtual function listen( port as ushort ) as integer
declare virtual function listen( addr as string, port as ushort ) as integer
declare virtual function listen( addr as uinteger, port as ushort ) as integer

Accepting A Request

Accept and transfer control to new socket: obj.accpet()
Accept from a CLionet instance: obj.accpet( pObjFoo )
Accept from a socket: obj.accpet( socket )

declare virtual function accept() as integer
declare virtual function accept( scklistener as CLionet ptr ) as integer
declare virtual function accept( scklistener as SOCKET ) as integer

Sending & Receiving

declare virtual function send( in_buf as any ptr, length as integer ) as integer
declare virtual function recv( out_buf as any ptr, length as integer, f_peek as integer = 0 ) as integer

Properties

declare property thesocket() as SOCKET

declare property remoteip() as zstring ptr
declare property remoteport() as ushort

declare property localip() as zstring ptr
declare property localport() as ushort