Skip to content

Tag: sockets

Socket buffer size not increasing

Output is – Current socket buff len = 41600 setsock opt success After setting socket buff len = 41600. Looks like receive buffer size is not increasing, any idea why this happens? Thanks in advance! Answer If the kernel is of newer version (2.6.17 or higher), checkout whether autotuning is enabled by ve…

Linux, C, epoll(), read() data incompleted?

Linux, C. Below issue only happens by using epoll(). If I use select() on server socket, there is no data loss. ============================= Update: I received errno =11 (Try again) in read(). Do I need to continue, or break the while loop? ============================= I have client side, send 1280 K data i…

How to send image data over linux socket

I have a relatively simple web server I have written in C++. It works fine for serving text/html pages, but the way it is written it seems unable to send binary data and I really need to be able to send images. I have been searching and searching but can’t find an answer specific to this question which …

C++ Sockets – Client gives segmentation fault (linux)

I created a server/client connection. The server and client both are compiling correctly but when I run the client, it gives me a Segmentation Fault (core dumped) I don’t know what I am doing wrong with my memory allocations. The program is not dangling or anything. I think my program is writing to a re…

SEGFAULT after recv from socket

I have next trouble: after receiving data from sockets, server app generates segfault and shutdown. Code of client and server side are below. server: Client: In other words, client connected successfully. But after sending message, server generate segm fault error. What went wrong? Answer When running the cod…

Can socket send fail cause a daemon program crash?

I have two applications running on Embedded Linux board. One runs as a daemon and other acts as an interface for it. They communicate with each other using Unix sockets. As to handle any abnormal termination of socket, I tried terminating the interface application [ctr+c]. But as a result, the daemon applicat…