告诉我如何从网络中获取清晰的字节数据?前任:
public void OnRecievedData(IAsyncResult ar)
{
Socket sock = (Socket)ar.AsyncState;
try
{
int nBytesRec = sock.EndReceive(ar);
if (nBytesRec > 0)
{
sound.PlayReceivedVoice(buffer);
// Array.Clear(buffer, 0, buffer.Length);
SetupRecieveCallback(sock);
}
else
{
sock.Shutdown(SocketShutdown.Both);
sock.Close();
}
}
catch (Exception) { }
}
我想删除之前收到的数据。谢谢