亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? csocket.cls

?? 簡單、實用、特別。 有很多不足之處
?? CLS
?? 第 1 頁 / 共 4 頁
字號:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "CSocket"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False

Option Explicit
'
'The CSocket protocol's constants as for
'the MS Winsock Control interface
Public Enum ProtocolConstants
    sckTCPProtocol = 0
    sckUDPProtocol = 1
End Enum
'
'The CSocket error's constants as for
'the MS Winsock Control interface
Public Enum ErrorConstants
    sckAddressInUse = 10048
    sckAddressNotAvailable = 10049
    sckAlreadyComplete = 10037
    sckAlreadyConnected = 10056
    sckBadState = 40006
    sckConnectAborted = 10053
    sckConnectionRefused = 10061
    sckConnectionReset = 10054
    sckGetNotSupported = 394
    sckHostNotFound = 11001
    sckHostNotFoundTryAgain = 11002
    sckInProgress = 10036
    sckInvalidArg = 40014
    sckInvalidArgument = 10014
    sckInvalidOp = 40020
    sckInvalidPropertyValue = 380
    sckMsgTooBig = 10040
    sckNetReset = 10052
    sckNetworkSubsystemFailed = 10050
    sckNetworkUnreachable = 10051
    sckNoBufferSpace = 10055
    sckNoData = 11004
    sckNonRecoverableError = 11003
    sckNotConnected = 10057
    sckNotInitialized = 10093
    sckNotSocket = 10038
    sckOpCanceled = 10004
    sckOutOfMemory = 7
    sckOutOfRange = 40021
    sckPortNotSupported = 10043
    sckSetNotSupported = 383
    sckSocketShutdown = 10058
    sckSuccess = 40017
    sckTimedout = 10060
    sckUnsupported = 40018
    sckWouldBlock = 10035
    sckWrongProtocol = 40026
End Enum
'
'The CSocket state's constants as for
'the MS Winsock Control interface
Public Enum StateConstants
    sckClosed = 0
    sckOpen
    sckListening
    sckConnectionPending
    sckResolvingHost
    sckHostResolved
    sckConnecting
    sckConnected
    sckClosing
    sckError
End Enum
'
'In order to resolve a host name the MSocketSupport.ResolveHost
'function can be called from the Connect and SendData methods
'of this class. The callback acceptor for that routine is the
'PostGetHostEvent procedure. This procedure determines what to
'do next with the received host's address checking a value of
'the m_varInternalState variable.
Private Enum InternalStateConstants
    istConnecting
    istSendingDatagram
End Enum
'
Private m_varInternalState As InternalStateConstants
'
'Local (module level) variables to hold values of the
'properties of this (CSocket) class.
Private mvarProtocol        As ProtocolConstants
Private mvarState           As StateConstants
Private m_lngBytesReceived  As Long
Private m_strLocalHostName  As String
Private m_strLocalIP        As String
Private m_lngLocalPort      As Long
Private m_strRemoteHost     As String
Private m_strRemoteHostIP   As String
Private m_lngRemotePort     As Long
Private m_lngSocketHandle   As Long
'
'Resolving host names is performed in an asynchronous mode,
'the m_lngRequestID variable just holds the value returned
'by the ResolveHost function from the MSocketSupport module.
Private m_lngRequestID      As Long
'
'Internal (for this class) buffers. They are the VB Strings.
'Don't trust that guy who told that the VB String data type
'cannot properly deal with binary data. Actually, it can, and
'moreover you have a lot of means to deal with that data -
'the VB string functions (such as Left, Mid, InStr and so on).
'If you need to get a byte array from a string, just call the
'StrConv function:
'
'byteArray() = StrConv(strBuffer, vbFromUnicode)
'
Private m_strSendBuffer     As String 'The internal buffer for outgoing data
Private m_strRecvBuffer     As String 'The internal buffer for incoming data
'
'Lenght of the Winsock buffers. By default = 8192 bytes for TCP sockets.
'These values are initialized in the SocketExists function.
'Now, I really don't know why I was in need to get these values.
Private m_lngSendBufferLen  As Long
Private m_lngRecvBufferLen  As Long
'
'Maximum size of a datagram that can be sent through
'a message-oriented (UDP) socket. This value is returned
'by the InitWinsock function from the MSocketSupport module.
Private m_lngMaxMsgSize     As Long
'
'This flag variable indicates that the socket is bound to
'some local socket address
Private m_blnSocketIsBound  As Boolean  'Added: 10-MAR-2002
'
'These are those MS Winsock's events.
'Pay attention that the "On" prefix is added.
Public Event OnClose()
Attribute OnClose.VB_Description = "Occurs when the connection has been closed"
Public Event OnConnect()
Attribute OnConnect.VB_Description = "Occurs connect operation is completed"
Public Event OnConnectionRequest(ByVal requestID As Long)
Public Event OnDataArrival(ByVal bytesTotal As Long)
Public Event OnError(ByVal Number As Integer, Description As String, ByVal sCode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Public Event OnSendComplete()
Public Event OnSendProgress(ByVal bytesSent As Long, ByVal bytesRemaining As Long)

Public Sub SendData(varData As Variant)
Attribute SendData.VB_Description = "Send data to remote computer"

  '
  'data to send - will be built from the varData argument

  Dim arrData()       As Byte

    'value returned by the send(sendto) Winsock API function
  Dim lngRetValue     As Long ':(燤ove line to top of current Sub
    'length of the data to send - needed to call the send(sendto) Winsock API function
  Dim lngBufferLength As Long ':(燤ove line to top of current Sub
    'this strucure just contains address of the remote socket to send data to;
    'only for UDP sockets when the sendto Winsock API function is used
  Dim udtSockAddr     As sockaddr_in ':(燤ove line to top of current Sub
    '
    On Error GoTo SendData_Err_Handler
    '
    'If a connection-oriented (TCP) socket was not created or connected to the
    'remote host before calling the SendData method, the MS Winsock Control
    'raises the sckBadState error.
    If mvarProtocol = sckTCPProtocol Then
        '
        If m_lngSocketHandle = INVALID_SOCKET Then
            Err.Raise sckBadState, "CSocket.SendData", _
                      "Wrong protocol or connection state for the requested transaction or request."
            Exit Sub '>---> Bottom
        End If
        '
      Else 'NOT MVARPROTOCOL...
        '
        'If the socket is a message-oriented one (UDP), this is OK to create
        'it with the call of the SendData method. The SocketExists function
        'creates a new socket.
        If Not SocketExists Then Exit Sub ':(燛xpand Structure or consider reversing Condition
        '
    End If
    '
    Select Case varType(varData)
      Case vbArray + vbByte
        'Modified 28-MAY-2002. Thanks to Michael Freidgeim
        '--------------------------------
        'Dim strArray As String
        'strArray = CStr(varData)
        arrData() = varData
        '--------------------------------
      Case vbBoolean
  Dim blnData As Boolean ':(燤ove line to top of current Sub
        blnData = CBool(varData)
        ReDim arrData(LenB(blnData) - 1)
        CopyMemory arrData(0), blnData, LenB(blnData)
      Case vbByte
  Dim bytData As Byte ':(燤ove line to top of current Sub
        bytData = CByte(varData)
        ReDim arrData(LenB(bytData) - 1)
        CopyMemory arrData(0), bytData, LenB(bytData)
      Case vbCurrency
  Dim curData As Currency ':(燤ove line to top of current Sub
        curData = CCur(varData)
        ReDim arrData(LenB(curData) - 1)
        CopyMemory arrData(0), curData, LenB(curData)
      Case vbDate
  Dim datData As Date ':(燤ove line to top of current Sub
        datData = CDate(varData)
        ReDim arrData(LenB(datData) - 1)
        CopyMemory arrData(0), datData, LenB(datData)
      Case vbDouble
  Dim dblData As Double ':(燤ove line to top of current Sub
        dblData = CDbl(varData)
        ReDim arrData(LenB(dblData) - 1)
        CopyMemory arrData(0), dblData, LenB(dblData)
      Case vbInteger
  Dim intData As Integer ':(燤ove line to top of current Sub
        intData = CInt(varData)
        ReDim arrData(LenB(intData) - 1)
        CopyMemory arrData(0), intData, LenB(intData)
      Case vbLong
  Dim lngData As Long ':(燤ove line to top of current Sub
        lngData = CLng(varData)
        ReDim arrData(LenB(lngData) - 1)
        CopyMemory arrData(0), lngData, LenB(lngData)
      Case vbSingle
  Dim sngData As Single ':(燤ove line to top of current Sub
        sngData = CSng(varData)
        ReDim arrData(LenB(sngData) - 1)
        CopyMemory arrData(0), sngData, LenB(sngData)
      Case vbString
  Dim strData As String ':(燤ove line to top of current Sub
        strData = CStr(varData)
        ReDim arrData(Len(strData) - 1)
        arrData() = StrConv(strData, vbFromUnicode)
      Case Else
        '
        'Unknown data type
        '
    End Select
    '
    'Store all the data to send in the module level
    'variable m_strSendBuffer.
    m_strSendBuffer = StrConv(arrData(), vbUnicode)
    '
    'Call the SendBufferedData subroutine in order to send the data.
    'The SendBufferedData sub is just a common procedure that is
    'called from different places in this class.
    'Nothing special - just the code reuse.
    Call SendBufferedData
    '
EXIT_LABEL:
    '

Exit Sub

    '
SendData_Err_Handler:
    '
    If Err.LastDllError = WSAENOTSOCK Then
        Err.Raise sckBadState, "CSocket.SendData", "Wrong protocol or connection state for the requested transaction or request."
      Else 'NOT ERR.LASTDLLERROR...
        Err.Raise Err.Number, "CSocket.SendData", Err.Description
    End If
    '
    GoTo EXIT_LABEL
    '

End Sub

Public Sub PeekData(varData As Variant, Optional varType As Variant, Optional maxLen As Variant)
Attribute PeekData.VB_Description = "Look at incoming data without removing it from the buffer"

  '

  Dim lngBytesReceived As Long    'value returned by the RecvData function

    '
    On Error GoTo PeekData_Err_Handler
    '
    'The RecvData is a universal subroutine that can either to retrieve or peek
    'data from the Winsock buffer. If a value of the second argument (blnPeek As Boolean)
    'of the RecvData subroutine is True, it will be just peeking.
    lngBytesReceived = RecvData(varData, True, IIf(IsMissing(varType), Empty, varType), _
                       IIf(IsMissing(maxLen), Empty, maxLen))
    '
EXIT_LABEL:
    '

Exit Sub

    '
PeekData_Err_Handler:
    '
    Err.Raise Err.Number, "CSocket.PeekData", Err.Description
    '
    GoTo EXIT_LABEL
    '

End Sub

Public Sub Listen()
Attribute Listen.VB_Description = "Listen for incoming connection requests"

  '

  Dim lngRetValue As Long 'value returned by the listen Winsock API function

    '
    On Error GoTo Listen_Err_Handler
    '
    'SocketExists is not a variable. It is a function that can
    'create a socket, if the class has no one.
    If Not SocketExists Then Exit Sub ':(燛xpand Structure or consider reversing Condition
    '
    'The listen Winsock API function cannot be called
    'without the call of the bind one.
    If Not m_blnSocketIsBound Then  'Added: 10-MAR-2002
        Call Bind
    End If                          'Added: 10-MAR-2002
    '
    'Turn the socket into a listening state
    lngRetValue = api_listen(m_lngSocketHandle, 5&)
    '
    If lngRetValue = SOCKET_ERROR Then
        mvarState = sckError

        Err.Raise Err.LastDllError, "CSocket.Listen", GetErrorDescription(Err.LastDllError)
      Else 'NOT LNGRETVALUE...
        mvarState = sckListening

    End If
    '
EXIT_LABEL:
    '

Exit Sub

    '
Listen_Err_Handler:
    '
    Err.Raise Err.Number, "CSocket.Listen", Err.Description
    '
    GoTo EXIT_LABEL
    '

End Sub

Public Sub GetData(varData As Variant, Optional varType As Variant, Optional maxLen As Variant)
Attribute GetData.VB_Description = "Retrieve data sent by the remote computer"

  '

  Dim lngBytesReceived As Long    'value returned by the RecvData function

    '
    On Error GoTo GetData_Err_Handler
    '
    'A value of the second argument of the RecvData subroutine is False, so in this way
    'this procedure will retrieve incoming data from the buffer.
    lngBytesReceived = RecvData(varData, False, IIf(IsMissing(varType), Empty, varType), _
                       IIf(IsMissing(maxLen), Empty, maxLen))
    '
EXIT_LABEL:
    '

Exit Sub

    '
GetData_Err_Handler:
    '
    Err.Raise Err.Number, "CSocket.GetData", Err.Description
    '
    GoTo EXIT_LABEL
    '

End Sub

Public Sub Connect(Optional strRemoteHost As Variant, Optional lngRemotePort As Variant)
Attribute Connect.VB_Description = "Connect to the remote computer"

  '

    On Error GoTo Connect_Err_Handler
    '
    'If no socket has been created before, try to create a new one
    If Not SocketExists Then Exit Sub ':(燛xpand Structure or consider reversing Condition
    '
    'If the arguments of this function are not missing, they
    'overwrite values of the RemoteHost and RemotePort properties.
    '
    If Not IsMissing(strRemoteHost) Then    'Added: 04-MAR-2002
        If Len(strRemoteHost) > 0 Then
            m_strRemoteHost = CStr(strRemoteHost)
        End If
    End If                                  'Added: 04-MAR-2002
    '
    If Not IsMissing(lngRemotePort) Then    'Added: 04-MAR-2002
        If IsNumeric(lngRemotePort) Then    'Added: 04-MAR-2002
            m_lngRemotePort = CLng(lngRemotePort)
        End If                              'Added: 04-MAR-2002
    End If                                  'Added: 04-MAR-2002
    '

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
粉嫩欧美一区二区三区高清影视| 国产福利一区在线观看| 久久久www成人免费无遮挡大片| 一本到不卡精品视频在线观看| 看国产成人h片视频| 亚洲美女视频在线| 国产日产欧美精品一区二区三区| 91精品久久久久久久久99蜜臂| 99久久夜色精品国产网站| 久久精品国产久精国产爱| 亚洲一区av在线| 国产精品久久久久三级| 久久综合给合久久狠狠狠97色69| 在线观看日韩av先锋影音电影院| 国产mv日韩mv欧美| 国内精品写真在线观看| 五月天一区二区| 一区二区三区在线视频观看 | 久久久久久一二三区| 欧美日韩精品电影| 日本高清不卡一区| 高清视频一区二区| 国产在线精品一区二区三区不卡| 三级欧美在线一区| 亚洲va国产天堂va久久en| 亚洲激情中文1区| 亚洲素人一区二区| 国产精品久久99| 国产日产欧美一区二区视频| 精品久久人人做人人爱| 日韩一二三四区| 3d成人动漫网站| 制服丝袜国产精品| 欧美精品一级二级| 91精品国产高清一区二区三区蜜臀 | 欧美视频一区二区在线观看| 91电影在线观看| 欧美性猛交xxxx乱大交退制版| 色综合色综合色综合色综合色综合| 白白色亚洲国产精品| 不卡的av中国片| 97久久精品人人爽人人爽蜜臀| 成人免费视频视频| av中文字幕不卡| 色综合天天综合色综合av| 91网站最新网址| 欧美日韩在线播放一区| 欧美精品在线一区二区三区| 欧美丰满美乳xxx高潮www| 欧美一区二区视频在线观看| 欧美xxxxxxxx| 国产视频一区在线播放| 国产精品美女一区二区| 日韩理论片中文av| 亚洲va欧美va天堂v国产综合| 日韩高清不卡在线| 极品少妇一区二区| 丁香婷婷综合色啪| 色婷婷av一区二区三区大白胸| 欧美亚洲综合另类| 欧美第一区第二区| 中文字幕免费在线观看视频一区| 一区在线中文字幕| 亚洲一区电影777| 九色|91porny| 99精品久久99久久久久| 在线观看亚洲精品视频| 日韩一二三区视频| 国产偷国产偷亚洲高清人白洁 | 精品国产a毛片| 中文字幕在线视频一区| 亚洲第一成年网| 国产乱子轮精品视频| 91久久一区二区| 日韩精品影音先锋| 亚洲免费在线电影| 免费不卡在线视频| 99v久久综合狠狠综合久久| 欧美欧美欧美欧美| 国产精品网曝门| 青青草一区二区三区| 岛国精品在线播放| 欧美久久久久中文字幕| 欧美国产国产综合| 视频一区在线视频| 不卡电影免费在线播放一区| 日韩一区二区高清| 亚洲另类色综合网站| 国产乱码精品一品二品| 欧美吻胸吃奶大尺度电影| 国产婷婷一区二区| 免费的成人av| 欧美午夜影院一区| 中文在线资源观看网站视频免费不卡 | 午夜国产精品一区| www.亚洲人| 精品国产sm最大网站| 亚洲午夜免费福利视频| 成人一区二区三区在线观看| 91精品国产91久久久久久最新毛片 | 久久精品一区二区三区四区| 亚洲一区二区三区三| 丁香啪啪综合成人亚洲小说| 欧美一区二区在线播放| 亚洲免费av在线| 欧美性大战久久久久久久 | 午夜精品久久久久久不卡8050| 国产成人精品在线看| 日韩女优av电影在线观看| 亚洲第一成年网| 91国偷自产一区二区使用方法| 欧美国产国产综合| 国产经典欧美精品| 久久综合久久综合九色| 男女激情视频一区| 欧美日韩精品电影| 亚洲已满18点击进入久久| 99热这里都是精品| 国产精品丝袜久久久久久app| 精品一区二区三区在线观看国产 | 精品国产乱码久久久久久久| 五月婷婷欧美视频| 欧美老女人第四色| 亚洲成av人片在线观看| 91黄色激情网站| 亚洲一区免费在线观看| 99久久99久久精品免费观看| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 国产日产精品1区| 国产精品一区二区无线| 久久一二三国产| 国产老肥熟一区二区三区| 亚洲精品一区在线观看| 国产主播一区二区三区| 精品国产sm最大网站| 国产精品888| 中文av一区特黄| 91丨porny丨最新| 亚洲资源在线观看| 欧美日高清视频| 日av在线不卡| 337p粉嫩大胆噜噜噜噜噜91av| 狠狠狠色丁香婷婷综合激情| 精品日韩在线一区| 国产一区999| 国产精品私房写真福利视频| yourporn久久国产精品| 一区二区三区在线免费播放| 欧美日韩一区二区三区不卡| 日韩精品一区第一页| 日韩免费看的电影| 国产一区二区三区观看| 国产精品久久久久aaaa樱花| 色婷婷综合在线| 亚洲成人在线免费| 日韩精品一区二区三区老鸭窝| 精品一区二区影视| 国产精品成人免费在线| 日本电影亚洲天堂一区| 午夜a成v人精品| 精品国产髙清在线看国产毛片 | 国产成人午夜片在线观看高清观看| 中文字幕精品一区二区三区精品| av中文字幕一区| 亚洲国产成人tv| 精品福利视频一区二区三区| 成人黄色片在线观看| 亚洲电影激情视频网站| 精品国产亚洲在线| 91无套直看片红桃| 蜜臀av一区二区| 日韩一区有码在线| 日韩一区国产二区欧美三区| 国产99久久精品| 亚洲va韩国va欧美va精品 | 日韩国产欧美在线播放| 久久久99精品久久| 欧美中文字幕一区二区三区| 久久99精品久久久| 亚洲精品乱码久久久久久久久| 91精品国产高清一区二区三区| 不卡一区二区中文字幕| 日韩成人一级片| 亚洲日本免费电影| 欧美r级在线观看| 91黄视频在线| 国产一区二区福利| 亚洲va欧美va国产va天堂影院| 国产欧美日韩卡一| 日韩免费高清视频| 在线观看欧美精品| 不卡电影免费在线播放一区| 九九在线精品视频| 亚洲mv在线观看| 国产精品亚洲人在线观看| 天堂一区二区在线| 日韩毛片高清在线播放| 国产日韩精品一区| 欧美电视剧免费全集观看| 欧美日韩一区 二区 三区 久久精品|