Your question is a bit confusing. "Sockets" are an abstraction provided by the operating system for a variety of networking protocols -- the most common of which tend to be TCP/IP or UDP/IP sockets. In other words, to communicate over TCP you have to create a socket.
ROS nodes inherently already communicate through TCP by default. When you subscribe to a topic, your node sends an XMLRPC request (which is HTTP over TCP btw) to the ROS master looking for nodes which publish the topic. If one exists, the master returns the host and port for the node which is advertising the topic. Likewise when one advertises a topic, XMLRPC is used to register with the master the host/port pair. When a subscribing node receives the host IP + port, it connects to that address over XMLRPC (the node has an internal XMLRPC server) which is used to negotiate a straight TCP connection with ROS with that node. For more details see the technical overview:
http://wiki.ros.org/ROS/Technical%20Overview
Once the TCP connection is established, the communication protocol is dictated by "TCPROS" -- i.e. the transport protocol for ROS on top of TCP (similarly there's UDPROS). You can find details of this protocol here if you choose to reimplement it.
http://wiki.ros.org/ROS/TCPROS
All of the TCP code has already been taken care of in "roscpp". I would attempt to port roscpp to your embedded device before attempting to reimplement TCPROS. Not only would you have to reimplement TCPROS, you would also have to deal with the ROS master which requires XMLRPC.
Another option is having an "adapter" process running on a machine communicating with your embedded device. This adapter process communicates with the embedded device using a straight TCP socket. The adapter can subscribe to any topics the embedded device is interested in and translate them to messages in the protocol you dictate. Likewise the adapter can convert messages sent by the embedded device into ROS messages that can then be published once received and translated by the adapter.