Thanks for the example Justin.
In Maya 2014 (Linux x64), in the MEL script editor, I executed the following code
==========================================================
commandPort -name ":6001" -stp "python" -po;
On the CentOS command line, I launch this code with python
============================================
import socket
import cPickle
maya = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
maya.connect(('localhost', 6001))
maya.send("import os\n")
maya.send("os.getpid()\n")
ret = maya.recv(1024)
print cPickle.loads(ret)
Here is the result being printed on the shell console
=====================================
nyue@francoislake 145% python maya_command_port_pickle.py
None
NOTE : I did add "\n" to the command being sent, otherwise, they are not being executed.