Active Sync 네트워크를 통해 Windows Mobile 장치로 보낸 모든 패킷을 수신 할 소켓을 열려고합니다. 특히 CS Network Sniffer for WindowsWindows Mobile 6 - .net Socket advice [Compact Framework 3.5]
:
전에서 코드를 사용하고
//For sniffing the socket to capture the packets has to be a raw socket, with the
//address family being of type internetwork, and protocol being IP
mainSocket = new Socket(AddressFamily.InterNetwork,
SocketType.Raw, ProtocolType.IP);
//Bind the socket to All Network Communication
mainSocket.Bind(new IPEndPoint(IPAddress.Parse("169.254.2.1"), 0));
나는 Active Sync를
을 통해 IP 설정에 특이 적으로 결합하고있어 다음과 같은 소켓 옵션을 사용할 수 없습니다 Windows Mobile에서 동일한 효과를 얻으려면 Windows Mobile에서 사용할 수있는 다른 옵션이 있습니까?
//Start receiving the packets asynchronously
mainSocket.BeginReceive(byteData, 0, byteData.Length, SocketFlags.None,
new AsyncCallback(OnReceive), null);
다시 - 내가 많은 도움이되지 않습니다 MSDN에서 본 목록은 마지막으로 코드 받기
//Set the socket options
mainSocket.SetSocketOption(SocketOptionLevel.IP, //Applies only to IPv4 packets
SocketOptionName.HeaderIncluded,
true);
byte[] byTrue = new byte[4] { 1, 0, 0, 0 };
byte[] byOut = new byte[4] { 1, 0, 0, 0 }; //Capture outgoing packets
//Socket.IOControl is analogous to the WSAIoctl method of Winsock 2
//IOControlCode.ReceiveAll is equivalent to SIO_RCVALL constant of Winsock 2
mainSocket.IOControl(IOControlCode.ReceiveAll, byTrue, byOut);
을 msdn.microsoft.com/en-us/library/aa926870.aspx 내 목표는 Active Sync 네트워크를 통해 내 Windows Mobile Device에서 TCP 및 UDP에 대한 모든 포트에서 들어오는 모든 패킷을 수신하는 것입니다. 도움말, 조언 또는 코드를 매우 높이 평가합니다. C#, VB.net, C++ 모두 좋습니다 :)