Commands are sent via Codec12 protocol. In your case you're not confirming the connection with 0x01 after you receive the IMEI of the device.
In order to send a command, the device first will connect to you, present itself (short hello packet containing the IMEI. At this point you should either accept the device (0x01) or reject it (0x00). Then the socket stays open and the device will start to report data via Codec8 or Codec8E. For every reported AVL data you have to ack it (short packet that contains the number of accepted "AVLs"), otherwise the device will close the connection and reconnect. Between the AVL data you could send commands encoded with Codec12.