Skip to content

Tag: sockets

issues using waitpid() with large number of child process

I have a c program to create a TCP socket and keep waiting for a connection in an infinite loop. Each time a client connected to the program, I would spawn a new child process to handle the client request. My program could only exit with signal interrupt (e.g. ctrl+c). I don’t want the parent process ha…

C sockets

The following C program calls select() to get a list of client sockets that have data in the socket buffer (using UNIX domain datagram sockets). It takes four parameters on call from a NASM program. The parameter fds_array[] is a 3-element integer array created in NASM and passed into the program. The data ar…

Control doesn’t move next to the select function

i am trying to implement a TCP server that accepts multiple client nodes. However, the control is just stuck at select() and not moving beyond that. This is my code: However, the control never moves beyond the select statement. It just remain there even after i open a connection to the server with telnet: Why…

What happens to TCP socket when IP address changes?

Is there any error on a socket when writing to it after IP address change? In my I’m using TCP socket, both read/write (non-passive), no TCP or application keep-alive. To inspect this case I use socat to connect to a simple echo server on my local network. The connection is OK until I change the client …