Sockets were invented in Berkeley around 1983, but how did networked computer programs work before this? These days, pretty much everything uses sockets, so it's hard for me to imagine how else programs could communicate and Google turned up nothing.
Berkeley socket was just an API that was invented then. The technology that sockets abstracts away was there before; ARPANET and TCP/IP stack was invented in the 70's and there were computer networks even before that.
Technically you can connect two computers with a serial cable an make them communicate over it.