I am using AF_UNIX,SOCK_STREAM socket for IPC between 2 different processes. The client is sending data over the socket which the server picks up and processes. The size of each block of data that the client writes to the socket is roughly 13 kilobytes using the following command:
Send Command in client : send(s, txPackDisp, sizeof(float)*PACKET_LENGTH, 0);
However, when I receive the data on the server using the following command :
Receive command in server : recv(s, bfoData, PACKET_LENGTH*sizeof(float),0);
the data received everytime is only partial of what I send (there are a lot of zeros in the end which should not be the case).
So my questions are :
Is there a limit on the maximum limit on the size of data that I can send over the AF_UNIX,SOCK_STREAM socket ( from what I have read , I dont think there is )
Does the socket break up the data into smaller blocks when transferring and if thats the case do I need to receive the smaller blocks individually or as single block like I am doing right now.
Will it be better to use AF_UNIX,SOCK_DGRAM socket here.
P.S : The source code for the main functions for the server and client can be seen in this question : IPC using Unix Domain Sockets
Copyright License:
Author:「anshu」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/24051965/maximum-limit-on-size-of-data-in-ipc-using-sockets-in-unix