title: Raw Socket in VB.net to Send and Receive
body: <p>So here's my issue I've been working with, I have a server socket that I need to receive raw data with. The idea is to capture raw packets so they can be analyzed and processed according to their header data.
  I've been doing so many debugging routines and google searches and read so many articles, but I have yet to find a way to get this working.</p>
  
  <p>So far, I am mainly getting stuck at the Listen() command. Init code is as follows:</p>
  
  <pre><code>s1 = New Net.Sockets.Socket(Net.Sockets.AddressFamily.InterNetwork, Net.Sockets.SocketType.Raw, Net.Sockets.ProtocolType.IPv4)
  Dim Lcip As New Net.IPAddress({192, 168, 1, 5})
  Dim ep As New Net.IPEndPoint(Lcip, 155)
  Dim maxcon As Int32 = 500
  s1.SetSocketOption(Net.Sockets.SocketOptionLevel.IP, Net.Sockets.SocketOptionName.HeaderIncluded, True)
  s1.Bind(ep)
  s1.Listen(Int32.MaxValue)
  s2 = s1.Accept
  </code></pre>
  
  <p>As I said, the Listen() command is where my program trips, and yes i have tried a normal value but to no avail.</p>
  
  <p>Any Ideas?</p>
  
  <p>Goal: Receive packet data containing full header(IP, MAC, chksum, SYN/ACK, etc..)
  Secondary Goal: Receive from any IP, and specify an adapter to monitor specifically(i.e. only wifi, or only wired lan)</p>