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 verifying the file /proc/sys/net/ipv4/tcp_moderate_rcvbuf . If the value
Tag: sockets
Bad File Descriptor on recv from TCP socket
I’ve got a trouble and can’t google out solution, so I hope you’ll be able to help me. There is a client-server application, something like text chat. Server accepts client’s connection, makes new socket for client and sends socket descriptor to it’s child process, that broadcasts received messages to all connected clients. server.c (error handling and tests are cuted out)
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 in 10 times (each time, I send 128K data); I
Understanding the msghdr structure from sys/socket.h
I’m trying to understand the following members of the msghdr structure of the sys/socket.h lib. struct iovec *msg_iov scatter/gather array void *msg_control ancillary data, see below It states below: Ancillary data consists of a sequence of pairs, each consisting of a cmsghdr structure followed by a data array. The data array contains the ancillary data message, and the cmsghdr structure
Just like IN_ADDRANY can we creat any macro for port number, such that we can bind to any port insteed of a particular port??
I want to receive the data from different ip addr with different port numbers and the reading the data is in infinite loop? Answer Can’t be done. It would conflict with all other bound sockets on the system. If what you really want to do is read any traffic coming in through the network interface, you need a packet capture
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 is written
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 read-only portion of the memory, or
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 code it seg faults at: Package is a struct with two members nick
Java read bytes from Socket on Linux
I’m trying to send a file from my Windows machine to my Raspberry-Pi 2, and I have a client and a server. The client should be able to send a zip file over the network to my server on my linux machine. I know my client and server work on Windows, as when I run both the client and server
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 application crashes. Since the socket is terminated, I get