⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modstats.bas

📁 用VB写的一个代理服务器程序.rar复件 用VB写的一个代理服务器程序.rar
💻 BAS
字号:
Attribute VB_Name = "modStats"
Option Explicit

Public ConnectionRequest As New Collection

Public Sub AddConnectionStatistic(Socket As Winsock)
Dim CStat As Cconnection

    If IsInCollection(ConnectionRequest, Socket.RemoteHostIP) Then
        Set CStat = ConnectionRequest(Socket.RemoteHostIP)
        CStat.Stat_Connect_Count = CStat.Stat_Connect_Count + 1
    Else
        Set CStat = New Cconnection
        CStat.IPAddress = Socket.RemoteHostIP
        'CStat.HostName = Socket.RemoteHost
        'CStat.HostName = NameByAddr(Socket.RemoteHostIP)
        CStat.Key = CStat.IPAddress
        CStat.Stat_Connect_Count = CStat.Stat_Connect_Count + 1
        ConnectionRequest.Add CStat, CStat.Key
    End If
    
    Set CStat = Nothing
End Sub

Public Sub AddStatReceived(Socket As Winsock, BytesReceived As Long)
    If IsInCollection(ConnectionRequest, Socket.RemoteHostIP) Then
        ConnectionRequest(Socket.RemoteHostIP).Stat_Bytes_Received = ConnectionRequest(Socket.RemoteHostIP).Stat_Bytes_Received + BytesReceived
    End If
End Sub

Public Sub AddStatSent(Socket As Winsock, BytesSent As Long)
    If IsInCollection(ConnectionRequest, Socket.RemoteHostIP) Then
        ConnectionRequest(Socket.RemoteHostIP).Stat_Bytes_Sent = ConnectionRequest(Socket.RemoteHostIP).Stat_Bytes_Sent + BytesSent
    End If
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -