O8. 连接

已达到授权极限(连接被拒绝)

按照授权许可协议的限制拒绝连接时调用

数据库

参数

返回值

可使用

id——工作站ID,

address——工作站网络地址,

station——工作站NetBIOS名称。不可替换为DNS名称,

type——station类型

忽略

钩子文本:

--[[

Called:

 when connection denied according license limitation

 

Database:

 available

 

Parameters:

 id             station ID

 address        station network address

 station        station name

                this is NetBIOS station name (not replaced by DNS one)

 type           one of 'station'

 

Returned value:

 ignored

 

]]

 

local args = ... -- args.id, args.address, args.station, args.type

 

-- no return => `nil' value

连接出错

无法与新客户端建立连接时调用。
可能原因:授权已结束(这时首先调用license_error.ds)、没有连接到数据库、数据库错误、等待登录的工作站数量超限、服务器或数据库超负荷。

数据库

参数

返回值

如原因为no license,可使用;如原因为overload,原则上可以访问(这时不建议使用数据库)

address——客户端地址,

reason——连接出错原因:

no database——未能与数据库建立连接,

overload——数据库超负荷,

no license——没有可用授权,无法接收连接

忽略

钩子文本:

--[[

Called:

 when new client connection cannot be established

 

Database:

 available if reason is "no license" and potentialy available if

 reason is "overload" (but it is not recommended to use DB that time)

 

Parameters:

 address                   client address

 reason   "no database"    no established database connection

          "overload"       database is overloaded

          "no license"     no free license to accept connection

 

Returned value:

 ignored

 

]]

 

local args = ... -- args.address, args.reason

从客户端获得PONG

从客户端获得PONG时调用。

数据库

参数

返回值

可使用

id——客户端ID

address——客户端网络地址,

station——客户端名称(对于代理端、服务器、安装程序),

time——数据包返回(round-trip)时间

忽略

钩子文本:

--[[

Called:

 when 'PONG' received from client

 

Database:

 available

 

Parameters:

 id         client ID

 address    network address

 station    station name (for Agent, Server, Installer)

 time       packet round-trip time in milliseconds

 

Returned value:

 ignored

 

]]

 

local args = ... -- args.id, args.address, args.station,

                -- args.time

同客户端的连接已中断

与客户端中断连接后调用。

数据库

参数

返回值

可使用

id——客户端ID

address——客户端网络地址,

type——客户端类型:unknownstationconsoleserverinstallernewbie

station——工作站名称(只用于代理端),

bytesin——接收到无压缩字节,

bytesout——已发送无压缩字节,

totalbytesin——接收到压缩字节,

totalbytesout——已发送压缩字节

reason——断开原因

忽略

钩子文本:

--[[

Called:

 when client disconnected

 

Database:

 available

 

Parameters:

 id              client ID

 address    network address

 type            client type: "unknown", "station", "proxy",

                               "server", "installer", "newbie"

 station         station name (only for Agent)

 bytesin         bytes received

 bytesout        bytes sent

 totalbytesin    compressed bytes received

 totalbytesout   compressed bytes sent

 reason          disconnect reason

 

Returned value:

 ignored

 

]]

 

local args = ... -- args.id, args.address, args.type, args.station

                -- args.bytesin, args.bytesout

                -- args.totalbytesin, args.totalbytesout

                -- args.reason