Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / darknet + memblock ?

Author
Message
OldPMan
TGC Store Seller
17
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 11th Nov 2009 08:24 Edited at: 17th Nov 2009 20:15
who can help?
what send memblock wholly with darnet - not byte by byte.


prompt that so not.
and else:
has rerun the computer.
has started taskmeneger.
in taskmanager loading processor 0-2%

has started the server and client, has sent the message.

has switched off server and client.
in taskmanager loading processor 10-20% and so until has rerun the computer.

this bug?

forall
Michael P
20
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 11th Nov 2009 16:57
Here is an example showing how you can use mnAddMemblock and mnGetMemblock:


OldPMan
TGC Store Seller
17
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 17th Nov 2009 20:17
this bug?
has rerun the computer.
has started taskmeneger.
in taskmanager loading processor 0-2%
has started the server(darkNET) and client(darkNET), has sent the message.
has switched off server(darkNET) and client(darkNET).
in taskmanager loading processor 10-20% and so until has rerun the computer.

forall
Michael P
20
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 17th Nov 2009 20:26
Can you show me the code you are using please?

OldPMan
TGC Store Seller
17
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 17th Nov 2009 20:35
yes.


server:


client:



and else:

I can not add string in package

in than my mistake.
excuse me for my bad language . and I bad understand HELP files

forall
Michael P
20
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 18th Nov 2009 00:16
You don't understand packets very well. Take a look here at the packet section for a reasonably detailed explanation of exactly how they work: http://newsfiles.thegamecreators.com/issue81/DarkNet_v116.pdf.

mnSetCursor changes the position at which data is added and got from packets. When you use mnGet commands the data is not deleted from the packet, the cursor just moves forward by the amount of data read.

This means that if you want to read a packet that you have just received you don't need to use mnSetCursor. You just use mnGet commands in the same order as the mnAdd commands used to create the original packet e.g. mnAddInt, mnAddString, mnAddFloat is used on the sending side, then mnGetInt, mnGetString and mnGetFloat should be used on the receiving side.

You are also not using strings correctly, this code snippet shows how you should use them in most cases:


There may be other mistakes in your code but this is what I've noticed at a glance. The application not exiting on close is probably due to memory corruption caused by mistakes in your code.

OldPMan
TGC Store Seller
17
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 23rd Nov 2009 13:36
HI Michael.

What might the greatest possible amount of data transmitted from client to server and vice versa?
What is the maximum recommended number of clients for the server?
what does it depend?
and your recommendations for the use of plugins (DarkNet).
thank you very much.............

.....already beside..... for all
Michael P
20
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 23rd Nov 2009 15:34
Quote: "What might the greatest possible amount of data transmitted from client to server and vice versa?
What is the maximum recommended number of clients for the server?
what does it depend?"

It depends on the hardware and bandwidth the server is running on. You can run your own tests to see what DarkNet is capable of as I haven't done any myself.

The number of clients connected doesn't really affect performance. mnClientJoined will take longer to return as the maximum number of clients increases. Other than that the number of clients has little impact on performance.

The number of packets being received has a significant impact on performance because mnSetFunction is not supported in the DBP version. This means that you have to use the packet queue system. It is possible that the queues are filled faster than you are able to deal with them; you are restricted by the rate at which DBP can call mnRecvUDP and mnRecvTCP. You can get around this problem using UM_PER_CLIENT and UM_PER_CLIENT_PER_OPERATION which automatically discard packets that are less useful (see the documentation for more information).

Packet size for TCP doesn't really matter, although large packets will perform slightly better than smaller packets. UDP packets should be restricted to a certain size as the protocol performs significantly worse once a certain size is reached. Anything below 200 bytes per packet should be fine.

Quote: "and your recommendations for the use of plugins (DarkNet)."

DarkNet can be used for any networking purpose.

Login to post a reply

Server time is: 2026-06-12 06:55:40
Your offset time is: 2026-06-12 06:55:40