A client-server system for remotely controlling smart home functions ( stubs are used instead of function ) over TCP/IP connection.
- Heating control (on/off)
- Door control (open/close)
- Pet feeding system
- Real-time system status monitoring
- Windows OS (uses Winsock2)
- C++ compiler with C++11 support
- Visual Studio 2019 or newer (recommended)
Run lab9_server.exe to start listening on port 54001.
Run lab9_client.exe to connect to the server at 127.0.0.1:54001.
To connect to a remote server, modify the IP address in the client source code.
- Heating:
heating:0(off) orheating:1(on) - Door:
door:0(close) ordoor:1(open) - Pet feeding:
food:amount(where amount is a portion of food) - Status:
status(displays current state of all systems) - Exit:
exitor5(terminate client)
- Single client connection at a time
- In-memory state (not persisted after restart)
- Uses blocking sockets for data exchange
If connection fails:
- Ensure server is running
- Check Windows Firewall settings
- Verify port 54001 is available
- Check server IP address in client code