Below I have some code. That code works fine on a LAN but when I move
to Wireless Devices or other dial-up connections I get only the
received packets and not the sent packets.
Is there any bug in the code below?
Thank you,
Nuno Magalhaes
---------------------------------
public void Run()
{
int len_receive_buf=4096;
int len_send_buf=4096;
byte[] receive_buf=new byte[len_receive_buf];
byte[] send_buf=new byte[len_send_buf];
int cout_receive_bytes;
Socket socket=new
Socket(AddressFamily.InterNetwork,SocketType.Raw,P rotocolType.IP);
socket.Blocking=false;
socket.Bind(new IPEndPoint(IPAddress.Parse(DefaultIPComboBox.Text) ,0));
socket.SetSocketOption(SocketOptionLevel.IP,Socket OptionName.HeaderIncluded,1);
byte[] IN=new byte[4]{1,0,0,0};
byte[] OUT=new byte[4];
int SIO_RCVALL=unchecked((int)0x98000001);
int ret_code=socket.IOControl(SIO_RCVALL,IN,OUT);
while(true)
{
IAsyncResult
ar=socket.BeginReceive(receive_buf,0,len_receive_b uf,SocketFlags.None,null,this);
cout_receive_bytes=socket.EndReceive(ar);
Receive(receive_buf);
}
}