hello, i have declared byte[] at runtime by allocating some memory.(socket programming)
public void OnDataReceived(IAsyncResult asyn)
{
CSocketPacket theSockId = (CSocketPacket)asyn.AsyncState;
try
{
int iRx = 0;
conn_arr =
"*0001";
conn_arr1 =
"*0001#\0";
//iRx = theSockId.thisSocket.EndReceive(asyn);
iRx = theSockId.m_currentSocket.EndReceive(asyn);
byte
[] power = new byte[iRx] ;
--
--
--
}
-> power is getting allocated for 1024 bytes,but i want to allocate only for the no of bytes received(iRx).