Glad it was helpful
Sure, you can communicate with the X2 in local network using sockets. You can implement the server/client protocol in 2 ways:
1.- You can create a server socket on the X2 listening for connections in a known port and then connect to that socket from the PC and ask for data.
2.- You can create the server socket on your PC listening for connections in a known port and make the X2 to connect to that socket each time you want to transmit data.
In both cases you will need to create a small communication protocol to transfer the data. This way you will know that a packet is received with a determinate lenght and data, something like this:
[MAGIC COOKIE/HEADER][DATA LENGTH][DATA]([CRC]optional)
[DATA] -> [COMMAND ID][PAYLOAD LENGTH][PAYLOAD]