3ad_Pr0grammer |
|
| Ragazzi, vi va di creare un chat tipo msn con i contatti e tutto? La mia idea era di avere un server che riceveva i messaggi e in automatico gli inviava al destinatario. es: CODICE TCPStartup()
$Array[];Un array contenenti tutti gli user $Array2[];E qui gli IP
While 1 $Listen=TCPListen(@IPAddress1,768) $Socket=TCPAccept($Listen) if $Socket=... then ;Se c' è qualcuno aggiunge user e ip negli array endif
$Comm=TCPRecv($Socket,2048) $Sp=StringSplit($Comm, "-x-") ;[2] il tuo user [3]user del dest.
If $Sp[1]="msg" Then TCPSend($Socket, Cerca l' ip nell' array corrispondente al user) EndIf
WEnd Più o meno avete capito? Vado in piscina, a dopo. Aspetto risposte. Non so però se puoi essere connesso con più IP..
|
| |