hello, i have declared byte[] at runtime by allocating some memory.(socket programming)
C#
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).
Bechir BejaouiRank #144 · 15.9K pointsPosted May 11, 2008, 2:55 AM EDT