Lib_binsock -        :
-(/)
-/   
-InputStream(Resource)

 1.1 -   flush      .

   :

JAVA:
-----

    public static void debug_register(int idx){}

    public static void enable_debug(int flag){}

    public static int open(String url){}

    public static void close(){}

    public static int available(){}

    public static int read_byte(){}

    public static int write_byte(int data){}

    public static InputStream get_in_stream(){}

    public static int write_bin(String data){}

    public static String read_bin(int len){}

    public static int rx_count(){}

    public static int tx_count(){}

    public static int flush(){}


Pascal:
-------

=>procedure debug_register(idx:integer);

  ,   
   (  )     
(Exception).

=>procedure enable_debug(flag:integer);

/  .
flag = 1 - 
flag = -1 - 
   .

  ,     
 -,    , :

[]
//sender -   ,    debug_register
//exception -    
//errstr -   (   )
//code -   (   )
procedure onerror(sender:Integer;exception:string;errstr:string;code:integer);
// ,        !
begin
 cmOK:=CreateCommand('OK',CM_OK,1);
 ShowAlert('Error #'+IntegerToString(code),'Exception: '+exception+chr(10)+chr(13)+'ErrorString: '+errstr, LoadImage('/icon.png'),ALERT_ERROR);
 delay(20000);
 ShowForm;
end;
[]

 code    :

 int ERR_OPENERROR  = 0; -   
 int ERR_CLOSEERROR = 1; -   
 int ERR_AVAILERROR = 2; -     
 int ERR_READERROR  = 3; -   
 int ERR_WRITEERROR = 4; -   
 int ERR_FLUSHERROR = 5; -   

!
 ,   ,    ,
     ;   ,  
 .


=>function open(url:string):integer;

    url.
 url :
socket://url:port

 1   ,   -1      
 ERR_OPENERROR.


=>procedure close;

 .

         ERR_CLOSEERROR.


=>function available:integer;

     .

    -1        ERR_AVAILERROR.


=>function read_byte:integer;

      ,     -1  
      ERR_READERROR.


=>function write_byte(data:integer):integer;

     data.

 1   ,   -1    ERR_WRITEERROR.


=>function get_in_stream:resource;

  resource  .


=>function write_bin(data:string):integer;

   data   .

 1   ,   -1    ERR_WRITEERROR.


=>function read_bin(len:integer):string;

     .

    null      ERR_READERROR.


=>function rx_count:integer;

   .


=>function tx_count:integer;

   . 


=>function flush:integer;

[ >= 1.1]

     

 1   ,   -1        
ERR_FLUSHERROR.

!
---------

    

  Motorola L9.

 1.1  10.04.10 20:45

(c) ViNT