I was wondering if there is an easy way to find the maximum size that is supported by Linux sockets? (Is this configurable? If so where?)
For example, most of the socket examples found on the web send "Hello Socket" or some such other small string, however if I put the whole of War And Piece into the socket, when does it break?
As everything is a file, is it the maximum file size?
I'm struggling here...
I'm trying to determine if data was successfully sent to the server through a TCP socket using the OutputStream object. For testing on emulator socket communications is loss after 30 sec. For write data OutputStream.write(); its doesn't throw an exception , and local server continuously running its not crashing, only tcp socket connection is loss after some time.
We are developing a network application based on C/S, in this application the server needs to transfer files to clients and sometimes receive files from clients. So in the server application, for every client it needs to create a control socket and many transfer sockets.
My question is how we can create and define a socket as role of control socket or transfer socket?
I've been trying to debug this problem and I think it might be due to a misunderstanding of how evSelectFD works.
I use ss -p to see TCP sockets information. But user info are not printed for some sockets, e.g. my SSH interactive login socket. My questions are:
Why are there sockets with no user associated?
Are these sockets with no user subjected to the owner module matching of iptables?
I have decided to use async io for my project and simply do a single threaded loop where I try to read some data each frame from each open socket. This worked quite well and overall I'm happy with it for now. The problem is weird problems I'm having with the async sockets.
I have a server that receives a continuous stream of data. As opposed to reading multiple times from a socket, I would like to read the entire data in socket receive buffer with one system call to read().
Of course I can pass a large buffer and read() will try to fill it with all available data.
I'm new in socket programming under Linux (UNIX) sockets.
I found the following code in the Internet, for a tcp-server that spawns a thread for each connection.
However it doesn't work.
the accept() function returns instantly, and doesn't wait for connection.
What am I doing wrong ?
this is the code
int main(int argv, char *args[])
{
struct sockaddr_in addr;
int sd, port;
port = hto
Message queues can send messages even when the other side is not present to read it, the other side can come slowly later and read the accumulated queue.
How do I achieve that in socket?