SDK Home Glossary Index Left Right Up

Net database


Section contents


Overview

Defined in

csocket.oxh

Description

<TBS>


Construction / destruction


NewNetDatabase

Usage

this& = NewNetDatabase&:

Description

Creates a net database object and returns a handle to the created object.

Return Value
this& A handle which represents the created net database object
Error Handling

If the object could not be created then an error is generated which should be trapped by an ONERR handler.

Example
  LOCAL this&

  this& = NewNetDatabase&:
  DeleteNetDatabase:(this&) 

DeleteNetDatabase

Usage

DeleteNetDatabase:(BYREF this&)

Description

Destroys the net database object.

Arguments
BYREF this& A handle for a net database object. A zero value is written back into the variable
Example
  LOCAL this&

  this& = NewNetDatabase&:
  DeleteNetDatabase:(this&) 

Methods provided


NetDatabaseAddA

Usage

NetDatabaseAddA:(this&,item&,BYREF status&)

Description

<TBS>

Arguments
this& A handle for a net database object
item& A handle to the item to add to the database
BYREF status& The status of the asynchronous operation.
Example
  LOCAL this&,entry&,status&

  this& = NewNetDatabase&:
  entry& = NewIASDatabaseEntry&:
  IASDatabaseEntrySetClassName:(entry&,"IrDA:IrCOMM")
  IASDatabaseEntrySetAttributeName:(entry&,"IrDA:TinyTP:LsapSel")
  IASDatabaseEntrySetToInteger:(entry&,4)

  NetDatabaseAddA(this&,entry&,status&)
  IOWAITSTAT32 status&
  NetDatabaseClose:(this&)

  DeleteIASDatabaseEntry:(entry&)
  DeleteNetDatabase:(this&) 
See Also

ISADatabaseEntry


NetDatabaseCancel

Usage

NetDatabaseCancel:(this&)

Description

Cancels any outstanding operation.

Arguments
this& A handle for a net database object

NetDatabaseClose

Usage

NetDatabaseClose:(this&)

Description

Closes a connection to the net database service.

Arguments
this& A handle for a net database object
Example
  LOCAL this&,entry&,status&

  this& = NewNetDatabase&:
  entry& = NewIASDatabaseEntry&:
  IASDatabaseEntrySetClassName:(entry&,"IrDA:IrCOMM")
  IASDatabaseEntrySetAttributeName:(entry&,"IrDA:TinyTP:LsapSel")
  IASDatabaseEntrySetToInteger:(entry&,4)

  NetDatabaseAddA(this&,entry&,status&)
  IOWAITSTAT32 status&
  NetDatabaseClose:(this&)

  DeleteIASDatabaseEntry:(entry&)
  DeleteNetDatabase:(this&) 

NetDatabaseOpen

Usage

err% = NetDatabaseOpen%:(this&,server&,family&,protocol&)

Description

Opens a connection to the net database service.

Arguments
this& A handle for a net database object
server& The socket server session; a handle to a SocketServ object
family& Specifies the address family
protocol& Specifies the protocol
Return value
err% The result of the operation

NetDatabaseQueryA

Usage

NetDatabaseQueryA:(this&,query&,response&,BYREF status&)

Description

<TBS>

Arguments
this& A handle for a net database object
query& A handle to a query object
response& A handle to a response object
BYREF status& The status of the asynchronous operation.
Error Handling

If the status& object cannot be created then an error is generated which should be trapped by an ONERR handler.

Example

The following code assumes that remAddr& contains a handle to a remote connection.

  LOCAL this&,query&,response&,status&,timChan%,timStat%,signals%,result%

  this& = NewNetDatabase&:
  entry& = NewIASDatabaseEntry&:
  IASDatabaseEntrySetClassName:(entry&,"IrDA:IrCOMM")
  IASDatabaseEntrySetAttributeName:(entry&,"IrDA:TinyTP:LsapSel")
  IASDatabaseEntrySetToInteger:(entry&,4)

  result% = IOOPEN(timChan%,"TIM:",0)
  IF result%<0
    RAISE result%
  ENDIF
  IOC(timChan%,1,timStat%,50)

  query& = NewIASQuery&:("IrDA:IrCOMM","IrDA::TinyTP:LsapSel",remAddr&);
  response& = NEWIASResponse&:
  NetDatabaseQueryA:(database&,query&,response&,status&)

  signals%=0
  WHILE 1
    IOWAIT
    IF status& <> KStatusPending32&
      IOCANCEL(timChan%)
      IOWAITSTAT timStat%
      BREAK
    ELSEIF timStat% <> KErrFilePending%
      NetDatabaseCancel:(database&)
      IOWAITSTAT32 status&
      PRINT "NetDatabaseQueryA: timed out"
      BREAK
    ELSE
      signals% = signals%+1
    ENDIF
  ENDWH

  WHILE signals%>0
    IOSIGNAL
    signals% = signals%-1
  ENDWH

  DeleteIASResponse:(response&)
  DeleteIASQuery:(query&)
  DeleteNetDatabase:(this&) 
See also

IASQuery, IASResponse


NetDatabaseRemoveA

Usage

NetDatabaseRemoveA:(this&,item&,BYREF status&)

Description

<TBS>

Arguments
this& A handle for a net database object
item& A handle to the object to remove from the database
BYREF status& The status of the asynchronous operation.
Error Handling

If the status& object cannot be created then an error is generated which should be trapped by an ONERR handler.


  SDK Home Glossary Index Left Right Up