1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Dim strBuffer as String
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    Dim temp As String
    Dim intDelimiter As Integer
    intDelimiter = 0
    Winsock1.GetData temp, vbString, bytesTotal
    strBuffer = strBuffer & temp
    Do
        DoEvents ' DoEvents는 상황에 따라서 사용합니다.
        intDelimiter = InStr(1, strBuffer, vbCrLf)
        If intDelimiter > 0 Then
            temp = Mid(strBuffer, 1, intDelimiter - 1)
            strBuffer = Mid(strBuffer, intDelimiter + 1, Len(strBuffer))
            ' CRLF로 나누어진 temp를 처리할 루틴 입력
        End If
    Loop Until intDelimiter = 0
End Sub

[참고] http://support.microsoft.com/kb/602093/ko


+ Recent posts