fb:porticula NoPaste
client.bas
Uploader: | ThePuppetMaster |
Datum/Zeit: | 12.12.2007 02:46:35 |
#include "TSNE.bi"
Dim G_Client as Integer
Dim BV as Long
Declare Sub TSNE_Disconnected (ByVal V_TSNEID as Integer)
Declare Sub TSNE_Connected (ByVal V_TSNEID as Integer)
Declare Sub TSNE_NewConnection (ByVal V_TSNEID as Integer, ByVal V_RequestID as Socket)
Declare Sub TSNE_NewData (ByVal V_TSNEID as Integer, ByRef V_Data as String)
Print "[INIT] Setup..."
TSNE_Event_Set(@TSNE_Disconnected, @TSNE_Connected, @TSNE_NewConnection, @TSNE_NewData)
Print "[INIT] Client..."
BV = TSNE_Create_Client(G_Client, "192.168.0.1", 80)
If BV = 0 Then
Print "[OK]"
Else: Print "[FEHLER] " & TSNE_GetGURUCode(BV)
End if
Print "[WAIT] ..."
TSNE_WaitClose(G_Client)
Print "[WAIT] OK"
Print "[END]"
end
Sub TSNE_Disconnected (ByVal V_TSNEID as Integer)
Print "[DIS]"
End Sub
Sub TSNE_Connected (ByVal V_TSNEID as Integer)
Print "[CON]"
Dim D as String
Dim CRLF as String
CRLF = Chr(13) & Chr(10)
D = D & "GET / HTTP/1.1" & CRLF
D = D & "Host: 192.168.0.1" & CRLF
D = D & "connection: close" & CRLF
D = D & CRLF
Print "[SEND] ..."
TSNE_Data_Send(V_TSNEID, D)
Print "[SEND] OK"
End Sub
Sub TSNE_NewConnection (ByVal V_TSNEID as Integer, ByVal V_RequestID as Socket)
Print "[NCO]"
End Sub
Sub TSNE_NewData (ByVal V_TSNEID as Integer, ByRef V_Data as String)
Print "[NDA]: >" & V_Data & "<"
End Sub