有人企图通过它的访问权限forbbiden的方式来访问一个插座。为什么? [英] an attempt was made to access a socket in a way forbbiden by it's access permissions. why?
本文介绍了有人企图通过它的访问权限forbbiden的方式来访问一个插座。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
private void StartReceivingData(string ipAddress, int iPort)
{
try
{
if (!_bContinueReciving)
{
//initializeMainSocket(ipAddress, iPort);
_mSocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);//<------HERE IS RAISED THE EXCEPTION
_mSocket.Bind(new IPEndPoint(IPAddress.Parse(ipAddress), iPort));
// _mSocket.Bind(new IPEndPoint(IPAddress.Loopback, iPort));
_mSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.HeaderIncluded, true);
_mSocket.IOControl(IOControlCode.ReceiveAll, new byte[4] { 1, 0, 0, 0 }, new byte[4] { 0, 0, 0, 0 });
//var 1
_mSocket.BeginReceive(_buffReceivedData, 0, _buffReceivedData.Length, SocketFlags.None,
new AsyncCallback(OnReceive), null);
initializeLocalSocket();
}
else
{
_bContinueReciving = false;
_mSocket.Close();
}
}
catch (Exception exception)
{
Debug.WriteLine(exception);
}
}
我不明白为什么...它的工作现在它没有。可能有人帮助我吗?
I正与VLC流媒体和我wan't接收数据包,做一些报告,然后restream本地的球员
I don't understand why...it worked and now it doesn't. could someone help me? i am streaming with vlc, and i wan't to receive the packets, do some reports, and then restream local to a player
推荐答案
最有可能的插座是由一些过程举行。使用的netstat -o
找哪一个。
Most likely the socket is held by some process. Use netstat -o
to find which one.
这篇关于有人企图通过它的访问权限forbbiden的方式来访问一个插座。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文