I am not an expert in C programming, but I'm trying to write a fairly simple program using sendmsg () and recvmsg () to send a message between the client and server (both are on the same machine, so basically I send the message to localhost).
After initializing the required structures (as in iovec and msghdr) and successfully connecting the client to the server, my sendmsg () call failed with errno "out of buffer space".
This is what linux reports about this type of error:
The output queue for the network interface has been full. This usually indicates that the interface has stopped sending, but may be caused by transient congestion. (This usually does not happen on Linux. Packets are simply silently deleted when the device queue is full.)
I looked on the Internet, and as a result I found out that sendmsg () is not widely used, and no one can relate to this type of error. The only good advice I found was to check for possible exceeding of open sockets, but again I always close EVERY socket that I create.
So, Iβm stuck, mainly because, being a completely noob, I donβt know exactly where to look for this problem.
If anyone knows how to act, it would be great. (And please do not tell me not to use sendmsg (), because the whole purpose of my work is to understand this scenario, and not send a message to myself)
Here is the code that I have written so far on pastebin: client and server
- solvable -
Many thanks. I was able to solve the problem, and I fixed other errors that I made, so the code for sendmsg () and recvmsg () working when sending messages: Client and Server works here