Page 1 of 1

Posted: Sun Apr 21, 2002 8:16 pm
by BackupUser
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
Christos

Posted: Sun Apr 21, 2002 9:59 pm
by BackupUser
Restored from previous forum. Originally posted by Danilo.

>If OpenNetworkConnection("loopback",6381)

Works very fine here -
started it 2 times on this PC
and everything is fine.

cya,
...Danilo

(registered PureBasic user)

Posted: Mon Apr 22, 2002 5:41 am
by BackupUser
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

Christos

Posted: Mon Apr 22, 2002 7:08 am
by BackupUser
Restored from previous forum. Originally posted by Danilo.

Yes, works fine with win2k.

I write a string in window 1, and
window 2 displays it correctly.

cya,
...Danilo

(registered PureBasic user)

Posted: Mon Apr 22, 2002 8:24 am
by BackupUser
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?

I have WIN98SE.

Posted: Mon Apr 22, 2002 11:19 am
by BackupUser
Restored from previous forum. Originally posted by tranquil.

I reported this bug many month ago as I had same problems with Sendnetworkstring$(). Seems not to be fixed now.

Fred wants to rewrite the Network lib as he told me some days ago in the PB Chat.

Alternative:
use the send_ and receive_ API commands and everything works fine.


Mike

Tranquilizer/ Secretly!
Registred PureBasic User

Posted: Mon Apr 22, 2002 12:52 pm
by BackupUser
Restored from previous forum. Originally posted by fred.

Or use SendNetworkData(String$, Len(String$))

Fred - AlphaSND