Optimizing UDP Multiclient Server for Efficient Content Streaming in C

  • Thread starter guest1234
  • Start date
  • Tags
    Server
In summary, the conversation is about creating a server that uses UDP and can handle multiple clients. The server should only send content to clients upon initial request to test its capacity. The current solution is a simple echo-server that sends data upon request, but there is concern about wasted overhead. The idea of implementing a custom handshake is mentioned, but there are potential issues with disconnecting the server. The question of whether there should be a signal between the server and clients for streaming and stopping is raised, as well as whether a media streaming server only sends data upon request. The use of C and/or UDP is also discussed.
  • #1
guest1234
41
1
Hi all

I'm trying to create a server that uses UDP and is capable of handling multiple clients. The server should 'stream' content to the clients only on the initial request (i.e. when starting the client). The general idea is to test how many clients is the server able to 'serve' before the packet loss exceeds 1%.

I've implemented simple echo-server: it sends data to the clients only if the latter requests to do so. However it's not what I want -- too much overhead is wasted on requesting new packages. Custom handshake with the server is achievable (although one must consider special cases where so-called ACK messages (still on UDP!) arrive too late) but disconnecting the server gets nastier.

Should there be some kind of bus between the server and clients, which signals the server to start streaming content to new clients and stops when client deattaches the 'session'?

Also, does a media streaming server send data to the client only if the latter requests?

Any pointers/tip appreciated.
 
Last edited:
Technology news on Phys.org
  • #2
Is using C and/or UDP a must?
 

1. What is a UDP multiclient server in C?

A UDP multiclient server in C is a type of server that uses the User Datagram Protocol (UDP) for communication and can handle multiple client connections simultaneously. It is written in the programming language C and is commonly used for real-time applications such as online gaming or streaming media.

2. How does a UDP multiclient server differ from a TCP server?

The main difference between a UDP multiclient server and a TCP server is the type of protocol used for communication. UDP is a connectionless protocol, meaning that data is sent without establishing a formal connection between the server and client. This can result in faster transmission times but also makes it more susceptible to errors or lost data compared to TCP, which is a connection-oriented protocol.

3. What are the advantages of using a UDP multiclient server?

One advantage of using a UDP multiclient server is its speed and efficiency. Since it does not establish a formal connection with clients, it can handle a larger number of clients and transmit data faster than a TCP server. Additionally, UDP is better suited for real-time applications where a small amount of lost data is acceptable, such as streaming media or online gaming.

4. What are some challenges of implementing a UDP multiclient server in C?

One challenge of implementing a UDP multiclient server in C is managing data loss and errors. Since UDP does not ensure reliable delivery of data, the server must handle any lost or corrupted data and retransmit if necessary. Additionally, the lack of a formal connection means that the server must keep track of which clients it is communicating with and manage their requests and responses accordingly.

5. How can I test my UDP multiclient server in C?

You can test your UDP multiclient server in C by using a network testing tool, such as Wireshark, to monitor the data being transmitted between the server and clients. You can also create multiple client connections and send various types of data to see how the server responds. Additionally, you can use unit testing frameworks to test the functionality of individual components of your server code.

Similar threads

Replies
7
Views
242
  • Programming and Computer Science
Replies
16
Views
1K
Replies
9
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
12K
Replies
7
Views
3K
  • Computing and Technology
Replies
4
Views
3K
  • Other Physics Topics
Replies
11
Views
23K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
4K
Back
Top