@Hoshee
danke für den DECLARE String, kannst Du mir sagen wie Du den
erstellt hast ?
Hier meinen bisherigen Code :
Dim hSock As Long
Dim rCoda As Long
Dim strAntwort As String
StartWinsock("TEST")
hsock = ConnectSock("localhost",4444,"",0,0)
rCode = SendData(hSock, "1|153|0000000002" & Chr$(10) )
If DataComeIn(hSock) >= 1 Then 'Sind daten gekommen ?
strAntwort = GetData(hSock)
DataArraived = True
Print "GetDate Ergebnis:" & strAntwort
End If
Hier die Funktionen :
Public Function GetData(Byval Sock As Long) As String
Dim Tmpstr As String * 1048, Retval As Long
Retval = recv(Sock, Byval Tmpstr, Len(Tmpstr), 0&)
GetData = Left$(Tmpstr, Retval)
End Function
Public Function DataComeIn(Byval Sock As Long) As Long
Dim Tmpstr As String * 1
DataComeIn = recv(Sock, Byval Tmpstr, Len(Tmpstr), MSG_PEEK)
If DataComeIn = -1 Then
DataComeIn = WSAGetLastError()
End If
End Function
Public Function SendData(Byval Sock As Long, Byval Data As String) As Long
SendData = send(Sock, Byval Data, Len(Data), 0&)
End Function