Yes, the XBee WIFI S6B module can send and receive data over any TCP or UDP socket providing you use the correct port numbers.
Now you just can't issue a Hex command to set a remote line high or low. You do need to send the proper API frames as well. to help you figure out where the issue is, I would suggest trying to send data between two WIFI modules.