本文介绍了适用于Windows Mobile 6的RAW套接字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开发一个使用RAW Sockets for Windows Mobile的应用程序。根据(http://msdn.microsoft.com/en-us/library/aa922428.aspx)上的信息,新版Windows Mobile支持RAW套接字。我在C#中工作,似乎无法创建一个设置了SIO_RCVALL值的RAW套接字。这是我的代码部分失败:

Socket _socket = new Socket(AddressFamily.InterNetwork,SocketType.Raw,ProtocalType.IP);

_socket.Bind(ipaddress,0);

byte [] _in = new byte [4] {1,0,0,0};
byte []
_out = new byte [4] {1,0,0,0};
int SIO_RCVALL = unchecked((int)0x98000001);

try {

_ socket.IOControl(SIO_RCVALL,_in, _out);

解决方案

I am trying to develop an application which uses RAW Sockets for Windows Mobile.  According to the information at (http://msdn.microsoft.com/en-us/library/aa922428.aspx) RAW Sockets are supported on new versions of Windows Mobile.  I am working in C# and cannot seem to create a RAW Socket with the SIO_RCVALL value set.  Here is the portion of my code which fails:

Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocalType.IP);

_socket.Bind(ipaddress,0);

byte[] _in = new byte [4] {1,0,0,0};
byte[]
_out = new byte [4] {1,0,0,0};
int SIO_RCVALL = unchecked ((int)0x98000001);

try{

_socket.IOControl(SIO_RCVALL, _in, _out);

解决方案


这篇关于适用于Windows Mobile 6的RAW套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 09:12