[TCP]Chat
Übersicht

![]() |
N0XBetreff: [TCP]Chat |
![]() Antworten mit Zitat ![]() |
---|---|---|
Hi!
So jetzt habe ich versucht einen TCP Chat in mein UDP Game einzubauen. Eigentlich sollte der Text den der Client sendet schonmal auf dem Server geschrieben werden, wird aber nicht. Ich weiß auch nicht ob ich vielleicht sonst noch ein paar Fehler gemacht habe. Hier TCP Server Code Code: [AUSKLAPPEN] Global Server = CreateTCPServer(5000)
While Not (KeyHit(1)) TCP() Wend CloseTCPServer(Server) End Function TCP() acc = AcceptTCPStream(Server) If acc Then ClientStrm = acc Else If ClientStrm <> 0 If ReadAvail(ClientStrm) Then Send_IP = TCPStreamIP(ClientStrm) RecMsg = ReadLine$(ClientStrm) Print recMsg EndIf EndIf EndIf End Function Und hier der Client Code Code: [AUSKLAPPEN] ;TCP KRAMS
Global Client = OpenTCPStream("127.0.0.1",5000) While Not KeyHit(1) TCP() Wend CloseTCPStream(Client) End Function TCP() If ReadAvail(Client) Then msg$ = ReadLine$(Client) EndIf If msg$ <> "" Then Text 10,10,msg$ If KeyHit(27) Then rer$ = Input("Send: ") WriteLine Client,rer$ EndIf End Function Mfg, N0X |
||
Projekte: |Tibario| http://www.blitzforum.de/worklogs/325/ | 5% |
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group