Why those IP addresses specifically?
The IP address of the server program will depend on which computer you run it on. The IP address is technically assigned per network interface (e.g. ethernet card in your computer or wifi connection). So if the computer you are running this on is 192.168.1.1, great. Otherwise you need to reconfigure it's network settings or run it on another device.
Network programming is not the same for all OSes. Linux, Windows and MacOS all do things a little differently. The core concepts are the same, and even the APIs are very similar, but they are not 100% compatible.
Then, you need to study up on network programming. I like
Beej's Guide. It's Linux oriented, but it's a great tutorial, and all of the concepts carry over to MacOS or Windows quite well. Google will turn up many more, for whatever OS you use.
Working through a good guide (no rushing or skipping steps) should give you some ideas of how to do your filter.