Maximum limit on size of data in IPC using sockets in unix

2014-06-05T13:02:27

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 :

  1. 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 )

  2. 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.

  3. 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

About “Maximum limit on size of data in IPC using sockets in unix” questions

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 ...
I am planning to use unix domain sockets for my IPC (inter process communication) between two processes running on same host machine. But I have to look into data security also before choosing unix
I need to set up some relatively simple IPC for Mac and it needs to be done using UNIX domain sockets. I'm brand new to Swift so while I know this is possible I'm struggling even create my client and
I'm breaking a big application into several processes and I want each process to communicate with each other. for now it's gonna be on the same server, but later several servers on same local netw...
I have two different applications where one of them has to feed data into the other. I am using Unix domain sockets for communicating between them. The client hooks onto the socket, checks for a se...
I want to communicate between NodeJS and a C program using node-ipc, over a Unix socket, which according to that homepage is the fastest option. (They will be on the same machine). That package cla...
For TCP/IP connections there is a maximum of 64k connections between two hosts if there's a single destination port (source: What is the theoretical maximum number of open TCP connections that a mo...
I need to setup local IPC between client and server. It is a case of single server and multiple clients and data need to be exchanged in both directions. The client is a command which sends the com...
This question follows on from the following: Communicating between NodeJS and C using node-ipc and unix sockets In regards to the accepted solution (https://stackoverflow.com/a/39848936/1834057),...
Is it better to use POSIX message queues or Unix domain sockets for local IPC communication? I have worked with Unix sockets between machines (not domain) and I remember that making and breaking the

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.