Yes, it is possible in MATLAB using the Instrument Control Toolbox, if the udp protocol is used. Also with sufficiently new versions of MATLAB, tcp could also be used.
You would need to use different MATLAB sessions for server and client. They could be started independently or one of them could start the other such as
system('matlab -nodisplay -r YourScriptName &')
Specify "localhost" or 127.0.0.1 as the host. Use any fixed port number above 32767 up to 65535 as the receiving port for one side, and a different port number in that range for the other side.