void __fastcall TForm2::send(TIdContext *AContext, unsigned char* s){
int size = sizeof(s)+2; //데이터 길이 읽기
unsigned char *data = new unsigned char[size]; //char어레이 생성
data[0] = size &0xff; //앞의 2개는 데이터 전체길이
data[1] = (size >> 0x08) & 0xff;
for(int i=2,j=0; iConnection->Socket->Write(data); //<<-- 이부분이 문제
}
어떻게 보내야할지 모르겠어요
WriteDirect()랑 Write()는 DynamicArray인가 로 정의돼있는데 가보니까 TBytes로 struct돼있던데 그것도 쓰는법을 모르겠고요;
그렇다고 String으로 교체해서 보내면 size 가 적으면 0부분에서 걸려버리니;;
|