Export conn's writePacket function