The old SSL certificate has expired and I want to renew the SSL certificate. However, the server already has established multiple links with other clients. So, can I just bind the old sockets to the new ssl, which means I don’t need to disconnect the old base tcp links? Answer Existing TLS connections don’t need to get updated with a
Tag: sockets
How do I install a signal handler for a custom I/O signal?
I am trying to set up a signal and signal handler to rebuffer CAN frames as they arrive. Below is my code. I can send a frame from the computer running this code, but when I send a frame back the other way, nothing happens. I am holding the programme with scanf(). Can you see why this signal handler is
bad file descriptor: error on accept() (socket)
I am trying to write a simple chat application using TCP protocol in Linux, in which server receives strings from the client and it sends strings size to the client. When I run client, the server throws a “Bad file descriptor” error and exits. Nevertheless if I send input strings by client it receives correct sizes of strings, but as
Parallel TCP connection using threads
I am trying to build a system that opens parallel TCP sockets using threads. My threads are triggered using message queue IPC , thus every time a packet arrive to the message queue a thread “wakes up” , open TCP connection with remote server and send the packet. My problem is that in Wireshark , I can see the the
Ping program implementation in C about recvfrom() doubts
I am searching for a long time on net. But no use. Please help or try to give some ideas how to achieve this. I have finished writing the program, and today when I tested the ping loopback address, after sending the packet, the function recvfrom() received the “first” packet (type 8), and the second recvfrom() received the response packet
If I bind a socket listener to a remote IP, can I still connect to the socket from localhost?
Normally, the IPC as configured in use is restricted to localhost (127.0.01) but a case has come up where a user requires the IPC connection to work additionally from a remote IP. If, in the call to the bind(2), I populate the relevant structure with the remote IP address, will I still be able to have other local processes connect
Setting both read() and send() timeouts for the same C socket on linux
I managed to set a read timeout for a C socket with: Now, I want to make this same socket timeouts for send operations. I have found in setsockopt that the proper way to set a timeout for send is quite similar, just replacing SO_RCVTIMEO by SO_SNDTIMEO: My question is if does a successive call of setsockopt overrides the previous
Is a connection to localhost copied over memory or disk?
AFAIK, there exist two methods for IPC over sockets. Unix sockets and TCP/IP sockets. UNIX domain sockets know that they’re executing on the same system, so they can avoid some checks and operations (like routing); which makes them faster and lighter than IP sockets. They also transfer the packets over the file system, meaning disk access is a natural part
Unexpected behaviour of SO_SNDTIMEO and SO_RCVTIMEO
I’m trying to set the timeout for the blocking TCP socket on Linux using setsockopt with SO_SNDTIMEO and SO_RCVTIMEO. But for some reason I get a lock while waiting on recv call. Consider the minimal example. I’ve shortened it a bit for readability, the full code is available in this gist. I create a server socket and set the timeouts
C++ + linux handle SIGPIPE signal
Yes, I understand this issue has been discussed many times. And yes, I’ve seen and read these and other discussions: 1 2 3 and I still can’t fix my code myself. I am writing my own web server. In the next cycle, it listens on a socket, connects each new client and writes it to a vector. Into my class