Buchempfehlung
Windows-Programmierung. Das Entwicklerhandbuch zur WIN32-API
Windows-Programmierung. Das Entwicklerhandbuch zur WIN32-API
"Der" Petzold, das über 1000 Seiten starke Standardwerk zum Win32-API - besonders nützlich u. a. bei der GUI-Programmierung in FreeBASIC! [Mehr Infos...]
FreeBASIC-Chat
Es sind Benutzer im FreeBASIC-Chat online.
(Stand:  )
FreeBASIC bei Twitter
Twitter FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!

fb:porticula NoPaste

Info
Info / Hilfe
Liste
Übersicht / Liste
Neu
Datei hochladen
Suche
Quellcode suchen
Download
Dateidownload

client_test.bas

Uploader:MitgliedThePuppetMaster
Datum/Zeit:08.12.2007 05:30:25

#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, ByVal 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, ByVal V_Data as String)
Print "[NDA]: >" & V_Data & "<"
End Sub