I have a server application written in c++, which is sending data to socket (and client is reading it). I need to restrict "upload speed" to that socket. Is there any easy way to do this? I have a number which respresents number of kB/s and that should be the upload speed.
I am using:
#include <sys/types.h>
#include <sys/socket.h>
ssize_t send(int sockfd, const void *buf, size_t len, int flags);