Fixed it. The problem was with the static ip that was set in the phone. Even though I had set the static ip of the android phone to 192.168.16.9, it was not so. To check this, go to sl4a->view->interpreter->shell and type 'netcfg' and press enter. Among the various things that appear i found that the ip written corresponding to 'wlan0' was 192.168.43.1. So I set the static ip of phone to the above ip and then changed my computers ip to 192.168.43.8. So the server should bind to s.bind(('192.168.43.8',port))
And the client should connect to the same address.