Forum > Networking and Web Programming

Synapse TCP/IP client and server(Second Edition)

(1/4) > >>

balazsszekely:
I rewrote a large part of the client/server application from the following thread: https://forum.lazarus.freepascal.org/index.php/topic,48677.0.html
Hopefully I managed to address all the issues mentioned there:
  - dropped RecvPacket(@kupferstecher)
  - thread safety(@kupferstecher and others)
  - the server's thread list now is properly locked with critical sections, each thread waits until the list is unlocked, no more connections are dropped(@piola)
  - server works as a daemon/service too(@datilas), tested only on windows
  - proper variables initialization(@Phoenix)

What's new:
  - each file transfer has been moved to a worker thread, parallel file transfer is now possible
  - newly connected/disconnected clients are highlighted for a custom amount of time
  - added a new project(server_stress_test), server can be tested up to few thousand connections(requires 64 bit, see notes for more details)
  - smaller stack size for each thread
  - many more

Notes:
  - there is a limited amount of threads that a 32 bit process(2 GB address space) can create. For better performance please build synapse client/server with a 64 bit version of Laz/FPC
  - developed with Lazarus_Trunk/FPC_3.2.0(64 bit) on the following OSs: Windows 10(64 bit) and Linux Mint Cinnamon 20.02(64 bit), with synapse trunk(rev. 267)
  - ico and res files are removed(forum attachment size limitation), please re-add the icons
  - I did not have enough time to thoroughly test the projects

datilas:
looking at the demo: synapse_daemon and synapse_client
imagining a scenario where synapse_daemon is active
and have 3 synapse_client connected on the server.

I couldn't understand how I could send message
from client1 to client2 or client 3
and I also could not understand how to send messages from any client to all clients

I'm a beginner so I'm asking
is there any demo in this situation?
Sorry for my English I use google translator.

balazsszekely:
@datilas

--- Quote ---looking at the demo: synapse_daemon and synapse_client
imagining a scenario where synapse_daemon is active
and have 3 synapse_client connected on the server.

I couldn't understand how I could send message
from client1 to client2 or client 3
and I also could not understand how to send messages from any client to all clients
--- End quote ---
You mean like in a chat application? This is not implemented currently, though it shouldn't be too difficult to implement. I mean the messaging part, audio/video streaming is done usually via udp hole punching, much more difficult to implement.


--- Quote ---I'm a beginner so I'm asking is there any demo in this situation?
--- End quote ---
Unfortunately no.


--- Quote ---Sorry for my English I use google translator.
--- End quote ---
No problem, I understood everything.

datilas:
it would be great if no server exists a method like:
GetClients so clients can see each other

datilas:

--- Quote from: GetMem on March 30, 2023, 05:33:23 pm ---@datilas
You mean like in a chat application? This is not implemented currently, though it shouldn't be too difficult to implement. I mean the messaging part, audio/video streaming is done usually via udp hole punching, much more difficult to implement.

--- End quote ---
yes. chat application.
in my situation it would be just text.

Navigation

[0] Message Index

[#] Next page

Go to full version