Author Topic: Hier bitte weitermachen!!!  (Read 5963 times)

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Hier bitte weitermachen!!!
« on: 2009-Jan-27 »
Hi,

hatte heute kurz vor feierabend ein wenig langeweile.
Kann das bitte jemand zuende machen?

mfg

Code: (glbasic) [Select]
// --------------------------------- //
// Project: HTTP
// Start: Monday, January 26, 2009
// IDE Version: 6.143

AUTOPAUSE FALSE

GLOBAL clients%[]
GLOBAL ip%,rv%
GLOBAL Header$

GLOBAL www$ = "htdocs/"
GLOBAL index$ = "index.html"


init% = SOCK_INIT()
IF init% < 0
PRINT NETGETLASTERROR$(),0,0
SHOWSCREEN
KEYWAIT
END
ENDIF

Server_Sock% = SOCK_TCPLISTEN(8080)

WHILE TRUE
Client_Sock% = SOCK_TCPACCEPT(Server_Sock%,ip%)
IF Client_Sock THEN DIMPUSH clients%[],Client_Sock

FOREACH a IN clients%[]
rv% = SOCK_RECV(a,msg$,512)
IF rv%
Header$ = Header$+msg$
ENDIF
NEXT

IF Header$ <> ""
anzahl = SPLITSTR(Header$,parts$[],"\r\n")
IF anzahl
y = 0
FOREACH muh$ IN parts$[]
hup$ = MID$(muh$,0,3)
IF hup$ = "GET"
blah = SPLITSTR(muh$,wuerg$[]," ")
IF blah
file$ = MID$(muh$,LEN(hup$)+1,LEN(wuerg$[1]))
DEBUG file$
ENDIF
ENDIF
PRINT muh$,0,30+y*10
y = y+1
NEXT
ENDIF
ENDIF

SHOWSCREEN
WEND
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC