Not tried it so it is a bit of a guess.
In Communications/Network/Protocol you can select Raw TCP/IP Active or Passive, not sure which to use.
Look top right and it tells you the Port Number.
You can open a file with Handle = OpenFile(FileLocation, Mode)
And you can read a file line by line using Line = ReadFileLine(Handle)
You send some text out of a port using:
PortPrint(PortNumber, Line)
Hopefully someone smarter will kick in, but it might get you started.