UDP Local Network Short Text Sending (All OS)
- RichAlgeni
- Addict
- Posts: 935
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: UDP Local Network Short Text Sending (All OS)
The packets should be delivered whole, but I don't think you can count on only getting just one packet per read. You are using start and end bytes, so that should help distinguish the packets just in case. One more thing you could do is add a length in bytes field, or pad out the packet to a consistent size.
Just a couple of thoughts.
Just a couple of thoughts.
Re: UDP Local Network Short Text Sending (All OS)
Not required here, as the receive data is separated by start and end characters, regardless of how it arrives.RichAlgeni wrote: Fri Sep 29, 2023 8:41 pm The packets should be delivered whole, but I don't think you can count on only getting just one packet per read. You are using start and end bytes, so that should help distinguish the packets just in case. One more thing you could do is add a length in bytes field, or pad out the packet to a consistent size.
Just a couple of thoughts.
Otherwise see module NetworkTCP
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
- skinkairewalker
- Enthusiast
- Posts: 782
- Joined: Fri Dec 04, 2015 9:26 pm
Re: UDP Local Network Short Text Sending (All OS)
I'm using this client to test the amount of load the server is supporting...
every 10ms, the 300 clients send a message to the server, until it supports it... but if I increase this number to 350, 400, n+...
It is already overloaded and clients are no longer able to perform basic functions, such as logging in for example.
Could it be a limitation of my hardware?
Or does the server really have this limitation on the number of connections per second?
start_udpclient.bat
udpclient.pb
every 10ms, the 300 clients send a message to the server, until it supports it... but if I increase this number to 350, 400, n+...
It is already overloaded and clients are no longer able to perform basic functions, such as logging in for example.
Could it be a limitation of my hardware?
Or does the server really have this limitation on the number of connections per second?
start_udpclient.bat
Code: Select all
@echo off
set "executable=client_udp.exe"
for /l %%x in (1,1,300) do (
start "" "%executable%"
)
exit
Code: Select all
Port = 6833
*Buffer = AllocateMemory(2048)
evnt.i = 0
ConnectionID = OpenNetworkConnection("127.0.0.1", Port,#PB_Network_UDP)
If ConnectionID
OpenConsole("pain test")
Repeat
evnt = NetworkClientEvent(ConnectionID)
Select evnt
Case #PB_NetworkEvent_Data
ReceiveNetworkData(ConnectionID, *Buffer, 2048)
PrintN("String: "+PeekS(*Buffer, -1, #PB_UTF8|#PB_ByteLength))
EndSelect
SendNetworkString(ConnectionID, #STX$ + "LifeTrigger udp new 10ms" + #ETX$, #PB_UTF8)
Delay(10)
ForEver
;CloseNetworkConnection(ConnectionID)
Else
MessageRequester("PureBasic - Client", "Can't find the server (Is it launched ?).", 0)
EndIf
End
Re: UDP Local Network Short Text Sending (All OS)
Calculate the data load per second.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
- skinkairewalker
- Enthusiast
- Posts: 782
- Joined: Fri Dec 04, 2015 9:26 pm
Re: UDP Local Network Short Text Sending (All OS)
How would I do this?
because in theory what would be the limitation?
number of available ports, hardware, limitation of the socket itself...
I can't find a way... xD
A potential solution would be to create a processing queue on the server??
because in theory what would be the limitation?
number of available ports, hardware, limitation of the socket itself...
I can't find a way... xD
A potential solution would be to create a processing queue on the server??
Re: UDP Local Network Short Text Sending (All OS)
Windows is not a real-time operating system.
In addition, many other protocols run over the network card that the operating system must process and distribute.
Then the server must also correctly allocate the 300 clients and store and report the 30000 received data per second.
So the server processes every 0,033 milliseconds a packet.
In your example as a local host, that is over 60000 UDP packets per second.
In addition, many other protocols run over the network card that the operating system must process and distribute.
Then the server must also correctly allocate the 300 clients and store and report the 30000 received data per second.
So the server processes every 0,033 milliseconds a packet.
In your example as a local host, that is over 60000 UDP packets per second.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
- skinkairewalker
- Enthusiast
- Posts: 782
- Joined: Fri Dec 04, 2015 9:26 pm
Re: UDP Local Network Short Text Sending (All OS)
What do you advise doing to make the server handle more than 10,000 connected users in an MMORPG Or applications that need to be critical with a high message demand??
Re: UDP Local Network Short Text Sending (All OS)
So it's not so easy with one server with Purebasic.
For this you need several servers with multiserver management with load distribution.
For this you need several servers with multiserver management with load distribution.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
- skinkairewalker
- Enthusiast
- Posts: 782
- Joined: Fri Dec 04, 2015 9:26 pm
Re: UDP Local Network Short Text Sending (All OS)
Would creating server instances on several different ports as if they were "channels" be a temporary solution?
and how would you measure the message load per second or millisecond?
and how would you measure the message load per second or millisecond?
Re: UDP Local Network Short Text Sending (All OS)
I am not a gamer server high performans programmer.
Besides, this is the wrong place to clarify this.
Please create a new request.
Besides, this is the wrong place to clarify this.
Please create a new request.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
- skinkairewalker
- Enthusiast
- Posts: 782
- Joined: Fri Dec 04, 2015 9:26 pm
Re: UDP Local Network Short Text Sending (All OS)
I will do that, thank you very much!