[DllImport("UdpRcv.dll")]
public static extern int UDP_InitPort(Int32 port);
[DllImport("UdpRcv.dll")]
public static extern int UDP_StartRCV(byte* buf, int len, byte* ip, ref int port);
[DllImport("UdpRcv.dll")]
public static extern int UDP_StopRCV();
byte[] tempRecvData = new byte[1024];
byte[] recvIP = new byte[100];
fixed (byte* pTempRecvData = tempRecvData)
{
fixed (byte* pRecvIP = recvIP)
bytes = UDP_StartRCV(pTempRecvData, byteData.Length, pRecvIP, ref recvPort);
}
for (int i = 0; i < bytes; i++)
{
byteData[i] = (byte)tempRecvData[i];
}