Extract methods `craete_ipv4_connection` and `create_ipv6_connection`
Handle errors in `fgets`

Add error handling function `safe_fgets`
Add description for assignment No. 1
Extract method `validate_ip_version`