Posted: Sun Apr 21, 2002 8:16 pm
Restored from previous forum. Originally posted by plouf.
as you should understand the same app start as a server or as
a client the problem is that the server receives the first
time the client string completty wrong and ater that not receiveing
at all what am i doing wrong ?
as you should understand the same app start as a server or as
a client the problem is that the server receives the first
time the client string completty wrong and ater that not receiveing
at all what am i doing wrong ?
ChristosInitNetwork():OpenConsole()
PrintN("S => server C => client")
a$=Input()
If a$ = "S"
CreateNetworkServer(6381)
Repeat
Select NetworkServerEvent()
Case 1
clientid = NetworkClientID()
PrintN("hello "+Str(clientid))
Case 5
str$ = ReceiveNetworkString(clientid)
PrintN(str$)
EndSelect
Until str$ = "quit"
ElseIf a$ = "C"
If OpenNetworkConnection("loopback",6381)
Repeat
PrintN("send string")
str$ = Input()
SendNetworkString(0,str$)
Until str$ = "quit"
EndIf
EndIf
If a$ = "S"
CloseNetworkConnection()
EndIf
PrintN("end program"):Delay(1000)
End