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 ?
InitNetwork():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
Restored from previous forum. Originally posted by plouf.
>If OpenNetworkConnection("loopback",6381)
Works very fine here -
started it 2 times on this PC
and everything is fine.
cya,
...Danilo
(registered PureBasic user)
you mean that sending string from client the server displays it correct
always ?
i have try this on me and on a friend pc i have win98se and my friend the same
Restored from previous forum. Originally posted by Pupil.
Hi,
it's not working properly here either, the first string is sent correctly as well as the second string, but when i try to send a third string the second string is sent once more and after this the server console is totaly dead i.e. it's not displaying anything no matter what i type in the client console.
How many strings in a row have you tried to send Danilo? Perhaps it's another of those OS related problems?