You know at times I admire how stupid I can be. So the problem was not the fault of Blender , of Python or ��of Pharo���. It was me , me and me :D
I was reading the Python 2 docs on sending data via sockets when I should be reading the Python 3 docs , because Blender uses Python 3 and in Python 2 data is sent as string and in Python 3 data is sent as binary.All I had to do was to convert the string to a binary . I would have seen the error but unfortunately because of a strange bug in Blender I cannot run it from terminal and so it does not display any errors :D
So yes problem solved and off I go to next stupid mistake. Coding is such a humiliating experience :D