Click here to Skip to main content
15,887,746 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: lock statement and decimal type Pin
David Menéndez Cisterna17-Nov-05 11:34
David Menéndez Cisterna17-Nov-05 11:34 
GeneralRe: lock statement and decimal type Pin
S. Senthil Kumar18-Nov-05 4:16
S. Senthil Kumar18-Nov-05 4:16 
GeneralRe: lock statement and decimal type Pin
S. Senthil Kumar18-Nov-05 4:18
S. Senthil Kumar18-Nov-05 4:18 
GeneralRe: lock statement and decimal type Pin
David Menéndez Cisterna18-Nov-05 4:32
David Menéndez Cisterna18-Nov-05 4:32 
QuestionCreate a ISAPI filter in .NET Pin
leejo12314-Nov-05 21:38
leejo12314-Nov-05 21:38 
QuestionProblems serializing a subclass of an ArrayList Pin
Skip.za13-Nov-05 3:07
Skip.za13-Nov-05 3:07 
QuestionProfile Switching? Pin
Eustov12-Nov-05 9:12
Eustov12-Nov-05 9:12 
QuestionSystem.Net.Sockets for reading IP packets? Pin
Tom Paluzzi11-Nov-05 4:47
Tom Paluzzi11-Nov-05 4:47 
I'm writing an application in C# that needs to sniff
all IP packets coming into a certain server. I've
tried to create a socket, bind, listening for
connections, but I'm getting an exception when i try
to listen on the created socket. It says "the operation
is not supported on the type of object".

I tried changing how I defined the IPEndPoint, and the
SocketType and ProtocolType enumerations when creating
the socket.

Does anybody know the correct setup of the socket in
order to inspect IP packets? Not at the TCP layer, but
lower in OSI model.

Is
Here's the code.

Thx,
Tom

try
{
// Build local end point
IPAddress localAddr = IPAddress.Parse(Constants.LOCALHOST);
IPEndPoint endpoint = new IPEndPoint(localAddr, Constants.PORT);

// create new IP socket.
server = new Socket(AddressFamily.InterNetwork,SocketType.Raw,ProtocolType.IP);

// SetupSocket(server);

// Bind the socket to the local IP addr and port
server.Bind(endpoint);

// Start listening for connections, allowing for max # to be queued.
server.Listen(Constants.MAX_CONNECTION_QUEUE);

// loop until the service is stopped.
while (ServiceStarted)
{
// Wait asynchronously for connections to be accepted.
server.BeginAccept(new AsyncCallback(this.AcceptCallback), server);

// yield
if (ServiceStarted)
{
Thread.Sleep(new TimeSpan(0, 0, 5));
}
.
.
.
}
}
catch(SocketException e)
{
throw e;
}


AnswerRe: System.Net.Sockets for reading IP packets? Pin
S. Senthil Kumar13-Nov-05 19:03
S. Senthil Kumar13-Nov-05 19:03 
Questionforms.timer vs thread.timer Pin
David Menéndez Cisterna10-Nov-05 6:26
David Menéndez Cisterna10-Nov-05 6:26 
AnswerRe: forms.timer vs thread.timer Pin
S. Senthil Kumar10-Nov-05 19:04
S. Senthil Kumar10-Nov-05 19:04 
GeneralRe: forms.timer vs thread.timer Pin
David Menéndez Cisterna11-Nov-05 2:01
David Menéndez Cisterna11-Nov-05 2:01 
QuestionRetrieving Public Contacts from Outlook Pin
chrisrm9-Nov-05 20:29
chrisrm9-Nov-05 20:29 
QuestionUrgent help needed Pin
NityaKakkar9-Nov-05 19:14
NityaKakkar9-Nov-05 19:14 
AnswerRe: Urgent help needed Pin
S. Senthil Kumar13-Nov-05 19:06
S. Senthil Kumar13-Nov-05 19:06 
QuestionHELP!!!!!!!- How to decompile .DLL file to get source code back? Pin
vicky4579-Nov-05 14:28
vicky4579-Nov-05 14:28 
AnswerRe: HELP!!!!!!!- How to decompile .DLL file to get source code back? Pin
Saksida Bojan9-Nov-05 20:46
Saksida Bojan9-Nov-05 20:46 
GeneralRe: HELP!!!!!!!- How to decompile .DLL file to get source code back? Pin
vicky45710-Nov-05 9:05
vicky45710-Nov-05 9:05 
AnswerRe: HELP!!!!!!!- How to decompile .DLL file to get source code back? Pin
lmoelleb10-Nov-05 1:44
lmoelleb10-Nov-05 1:44 
Questioncustomize shortcut during installation Pin
kani989-Nov-05 12:02
kani989-Nov-05 12:02 
AnswerRe: customize shortcut during installation Pin
rwestgraham9-Nov-05 14:49
rwestgraham9-Nov-05 14:49 
Question.NET 2.0?? Pin
HahnTech9-Nov-05 7:41
HahnTech9-Nov-05 7:41 
AnswerRe: .NET 2.0?? Pin
HahnTech9-Nov-05 10:23
HahnTech9-Nov-05 10:23 
GeneralRe: .NET 2.0?? Pin
HahnTech14-Nov-05 5:51
HahnTech14-Nov-05 5:51 
GeneralRe: .NET 2.0?? Pin
Dave Kreskowiak15-Nov-05 8:08
mveDave Kreskowiak15-Nov-05 8:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.