9.4 Connection Object

Represents a connection to the NetWare server.

9.4.1 Address property

Returns the NetAddress object that represents the client address.

Syntax

object.Address

Type

NetAddress.

Attributes

Read-only.

Example

This example returns the NetAddress object that represents the client address.

’Find the 10th connection and list the connection information 
set srv = createobject ("ucx:Server") 
set conns = srv.clients 
set Connection=conns.Element(10) 
     print (Connection.Address.Node) &" is the address of the client"

See Also

9.4.2 ConsoleRight property

Determines whether or not the current connection has console rights.

Syntax

object.ConsoleRight

Type

Boolean.

Attributes

Read-only.

Example

This example determines whether or not the current connection has console rights.

’Find the 10th connection and list the connection information 
set srv = createobject ("ucx:Server") 
set conns = srv.clients 
set Connection=conns.Element(10) 
     print (Connection.ConsoleRight)

9.4.3 Id property

Returns the connection ID number.

Syntax

object.Id

Type

Integer.

Attributes

Read-only.

Example

This example returns the connection ID number.

’Find the 10th connection and list the connection information 
set srv = createobject ("ucx:Server") 
set conns = srv.clients 
set Connection=conns.Element(10) 
     print (Connection.Id) &' is the connection ID'

9.4.4 LoginTime property

Returns the login time.

Syntax

object.LoginTime

Type

Date.

Attributes

Read-only.

Example

This example returns the login time.

’Find the 10th connection and list the connection information 
set srv = createobject ("ucx:Server") 
set conns = srv.clients 
set Connection=conns.Element(10) 
     print (FormatDateTime(connection.logintime, vbLongDate))

9.4.5 Name property

Returns the connection name.

Syntax

object.Name

Type

String.

Attributes

Read-only.

Example

This example returns the connection name.

’Find the 10th connection and list the connection information 
set srv = createobject ("ucx:Server") 
set conns = srv.clients 
set Connection=conns.Element(10) 
     print (Connection.Name) &' is the connection name'

See Also

9.4.6 Disconnect method

Disconnects the client connection.

Syntax

object.Disconnect()

Parameters

None.

Return Values

Boolean. Returns TRUE if the connection is successfully disconnected; otherwise, returns FALSE.

Example

This example disconnects the client connection.

’Find the 10th connection and send a message 
set srv = createobject ("ucx:Server") 
set conns = srv.Clients 
set Connection=conns.Element(10) 
if (connection.disconnect()) Then 
     print "Disconnected the first connection" 
else 
     print "Failed to disconnect the first connection" 
end if

9.4.7 Send method

Sends a broadcast message to the current client connection.

Syntax

object.Send( 
   Message As String)

Parameters

Message

The message to send to the client.

Return Values

Boolean. Returns TRUE if the message is sent; otherwise, FALSE.

Example

This example sends the message "This connection is being terminated" to the current client connection.

’Find the 10th connection and send a message 
set srv = createobject ("ucx:Server") 
set conns = srv.Clients 
set Connection=conns.Element(10) 
if (connection.send (" This connection is being terminated") ) then 
     print "Sent a broadcast message to " " &connection.name 
else 
     print "Failed to send a broadcast message to "&connection.name 
end if