Made changes to socket connection and implemented file watching using pyinotify