Buchempfehlung
Windows System Programming
Windows System Programming
Das Kompendium liefert viele interessante Informationen zur Windows-Programmierung auf Englisch. [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.bas

Uploader:MitgliedThePuppetMaster
Datum/Zeit:06.12.2007 12:35:15

#include "TSNE.bi"

Dim G_Client as TSNE_Socket
Dim BV as Long
Declare Sub TSNE_Disconnected (ByRef V_Socket as TSNE_Socket)
Declare Sub TSNE_Connected (ByRef V_Socket as TSNE_Socket)
Declare Sub TSNE_NewConnection (ByRef V_Socket as TSNE_Socket, ByRef V_RequestID as Socket)
Declare Sub TSNE_NewData (ByRef V_Socket as TSNE_Socket, ByRef V_Data as String)
Declare Sub TSNE_SendSuccess (ByRef V_Socket as TSNE_Socket, ByRef V_Bytes as Long)


Print "[INIT] Setup..."
TSNE_Event_Set(@TSNE_Disconnected, @TSNE_Connected, @TSNE_NewConnection, @TSNE_NewData, @TSNE_SendSuccess)

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 (ByRef V_Socket as TSNE_Socket)
Print "[DIS]"
End Sub



Sub TSNE_Connected (ByRef V_Socket as TSNE_Socket)
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_Socket, D)
Print "[SEND] OK"
End Sub



Sub TSNE_NewConnection (ByRef V_Socket as TSNE_Socket, ByRef V_RequestID as Socket)
Print "[NCO]"
End Sub



Sub TSNE_NewData (ByRef V_Socket as TSNE_Socket, ByRef V_Data as String)
Print "[NDA]: >" & V_Data & "<"
End Sub



Sub TSNE_SendSuccess (ByRef V_Socket as TSNE_Socket, ByRef V_Bytes as Long)
Print "[SES]"
End Sub