I wrote a simple rtsp server using live555. I took most of the code from here Live555: X264 Stream Live source based on "testOnDemandRTSPServer"
When a new client connects, it begins to receive packets from the one that currently came from the encoder. This can be a P-frame and an I-frame. How can I make sure that when connected, the client starts receiving data only from the I-frame?
You could inspect the nal unit type, based on your requierements i think deliverFrame would be good, i dont check the whole code but nal unit have information about the frame Type.
Look Here for more Infos H264 Nal Unit you can identify the I-Frame by Coded slice of an IDR picture