English
Source / code snippets

example Sockets Tcp Winsock

 

CompileMarkSeparation
!Source wurde am 29.05.2006 in die Babyklappe auf XProfan.Com abgelegt:
------------------------------------------------------------------------------- ----------------
 $I Winsocks.inc
Declare data1$,data2$,IP$
Declare sockTCP1&,sockTCP2&
Declare a1&,a2&,Ende%

Proc WSAerror

    PARAMETERS nr%, Text$ Routine zur Fehler wiedergabe des Winsocks

    if nr% = 0

        Print Text$+" OK"

    else

        Print Text$+" ERROR"

    endif

Endproc

CLS
USERMESSAGES 5000,5001
Init 1,1
WSAerror @&(0),"Winsocks INIT: "
CreateSocketTcp
sockTCP1& = @&(0)
SocketToThreatTcp sockTCP1&,5000,%hWnd Socket wird als Threat gestartet so blockiet der socket nicht bei vielen befehlen/ wenn diese Proc Error liefert bitte
WSAerror @&(0),"Socket to Threat: " die reihenfolge der Parameter in der Winsoks.inc überprüfen habe da einen dreher in der Proc SocketToThreatTcp
Falsche Error& = w32_WSAAsyncSelect(Socket&,Message&,FensterHandle&, 1 ) reihenfolge
Richtige Error& = w32_WSAAsyncSelect(Socket&,FensterHandle&,Message&, 1) reihenfolge
IP$ = "192.67.198.62"
ConnectTcpTo 110,IP$,sockTCP1&
WSAerror @&(0),"Connect: " Wird Error ausgeben weil der Socket als Threat läuft ist aber ok so

WhileNot Ende%

    WAITINPUT

    IF %UMessage = 5000 Message vom Socket wenn Daten eintrefen

        recfrom socktcp1&
        data1$ = @$(0)
        print data1$

        if @InStr("+OK POP3",data1$) > 0

            sendTCP sockTCP1&, @add$("user test@hangagud.de", "
            ")
            print "sende User"

        Endif

        if @InStr("+OK Waiting",data1$) > 0 leider klappt das login bei meinen E-Mail Anbieter nicht so das ich die anderen funktionen

            sendTCP sockTCP1&, @add$("pass blabla", "
            ") nicht mit einbinden konnte, dieser Programm Code sollte aber zur Demonstration reichen und die
            print "sende Passwort:" recfrom Proc sollte nicht mehr Blockieren wenn keine Daten ankommen

        Endif

    ENDIF

wend

CloseSocketx sockTCP1&
CloseWinsocks
 
05/29/06  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.431 Views

Untitledvor 0 min.
Thomas Zielinski05/31/24
Member 361000508/05/22
Sven Bader10/10/21
H.Brill05/16/19
More...

Themeninformationen

this Topic has 1 subscriber:

unbekannt (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie