Gereral Network Questions

Everything else that doesn't fall into one of the other PB categories.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

howdy ho!!

I'm back again. :)

Some general questions to the network-lib of PB:

1.) What is the ClientID, and mainly, how is it defined? What is the max Value of this?
2.) What happens if I have more connections open (server side)to clients with differentline speed (eg. Internet Modem/ DSL etc.)and sending Datas using the Networksenddata command in a Repeat/until loop and the line can not prozess the datas as fast as the server send it.
I want to use packets of 1024 or 2048 bytes to obtain this problem and waiting for the other side to replay for requesting more datas. Is that the right way?

Hope someone understand my bad english. :)))

Mike

Tranquilizer/ Secretly!
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

I think (Correct me fred if i am wrong)
the net-functions based on TCPIP (sockets) or perhaps UDP's.
The speed of your connection is not the problem(or if you had a 300 Baud modem it can), because there is normaly a timeout while configurating the sockets
(PureBasic did these for you),the socket's can bee run asyncron or syncron.
I did not know how fred did it.Try it out.
ClientID ? It Should be the Portnumber.The PortNumber
can bee ranged from 1 to 65536 (Word-Range) but remember that the well known Ports are range below 1000.(These wellknown ports are for example
7 Echo, 21 FTP, 80 HTTP and so on )
hope this helps.

Siggi
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

Okay, I will try the best packed size but do you realy think that the ClientID are ports?? I could not believe that, I think it is a kind of network address couse I get ClientIDs arround 38 and 40. Can't choose these IDs my selfe, purebasic do it for me.

Fred, what is the max ClientID I can get? Couse this is the max number of possible clients on a server right? I need to know this couse I must allocate enough memory at the beginning and the list handling of connected clients will be easier then. Thanks a lot. :)

PS: The ReceiveNetworkString is Buggy. Use Send/ReceiveNetworkData instead.

Mike

Tranquilizer/ Secretly!
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Client on a server aren't limited. ClientID is the Windows socket ID returned when the socket is created. This means you can use any socket command with it. It's not PureBasic which choose this number :). Else, PureBasic handle the network event asynchronously, so a read never block which allows to handle any number of connection very quickly, without need of Threads. I even think my system is better than Thread method, but it's another topic :-D. About the String() methods, please send me the source which fails, here it works well.

All the network lib is based on TCP, which mean a reliable connection. An UDP option will be added for faster game/multimedia application (no reliability but faster packet sending).

Fred - AlphaSND
Post Reply