473,772 Members | 2,411 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

promiscuous sockets

Is there any way to use a C# socket in promiscuous mode?
Any sample code that shows how this is done?

any assistance is much appreciated!
thanks
LK
Nov 16 '05 #1
6 7000
Isn't that illegal?

I know the linux platform lets you hack into the TCP/IP stack when using C++
to do this, but I would be very surprised if Microsoft didn't seal that door
shut in its Windows TCP/IP stack.

Then again, I do not know, so this is a non-answer.

Jon
"Laxmikant Rashinkar" <LK@televital.c om> wrote in message
news:ek******** ******@TK2MSFTN GP12.phx.gbl...
Is there any way to use a C# socket in promiscuous mode?
Any sample code that shows how this is done?

any assistance is much appreciated!
thanks
LK

Nov 16 '05 #2
Are you referring to UDP? Uh, please ignore previous post!! I was thinking of something else (i.e. having sex with someone else's TCP socket).

Take a look at the UdpClient Class.

Jon

---
.NET Framework Class Library

UdpClient Class
See Also
UdpClient Members | System.Net.Sock ets Namespace | TcpClient | TCP/UDP | UdpClient Members (Visual J# Syntax) | Managed Extensions for C++ Programming

Requirements
Namespace: System.Net.Sock ets

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: System (in System.dll)

..NET Framework Security:

a.. SocketPermissio n To establish an outgoing connection or accept an incoming request.
Language
a.. C#

b.. C++

c.. JScript

d.. Visual Basic

e.. Show All
Provides User Datagram Protocol (UDP) network services.

For a list of all members of this type, see UdpClient Members.

System.Object
System.Net.Sock ets.UdpClient

[Visual Basic]
Public Class UdpClient
Implements IDisposable
[C#]
public class UdpClient : IDisposable
[C++]
public __gc class UdpClient : public IDisposable
[JScript]
public class UdpClient implements IDisposable
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks
The UdpClient class provides simple methods for sending and receiving connectionless UDP datagrams in blocking synchronous mode. Because UDP is a connectionless transport protocol, you do not need to establish a remote host connection prior to sending and receiving data. You do, however, have the option of establishing a default remote host in one of the following two ways:

a.. Create an instance of the UdpClient class using the remote host name and port number as parameters.
b.. Create an instance of the UdpClient class and then call the Connect method.
You can use any of the send methods provided in the UdpClient to send data to a remote device. Use the Receive method to receive data from remote hosts.

Note Do not call Send using a host name or IPEndPoint if you have already specified a default remote host. If you do, UdpClient will throw an exception.
UdpClient methods also allow you to send and receive multicasted datagrams. Use The JoinMulticastGr oup method to subscribe a UdpClient to a multicast group. Use the DropMulticastGr oup method to unsubscribe a UdpClient from a multicast group.

Example
[Visual Basic, C#, C++] The following example establishes a UdpClient connection using the host name www.contoso.com on port 11000. A small string message is sent to two separate remote host machines. The Receive method blocks execution until a message is received. Using the IPEndPoint passed to Receive, the identity of the responding host is revealed.

[Visual Basic]
' This constructor arbitrarily assigns the local port number.
Dim udpClient As New UdpClient()
Try
udpClient.Conne ct("www.contoso .com", 11000)

' Sends a message to the host to which you have connected.
Dim sendBytes As [Byte]() = Encoding.ASCII. GetBytes("Is anybody there?")

udpClient.Send( sendBytes, sendBytes.Lengt h)

' Sends message to a different host using optional hostname and port parameters.
Dim udpClientB As New UdpClient()
udpClientB.Send (sendBytes, sendBytes.Lengt h, "AlternateHostM achineName", 11000)

'Blocks until a message returns on this socket from a remote host.
Dim RemoteIpEndPoin t As New IPEndPoint(IPAd dress.Any, 0)

' Blocks until a message returns on this socket from a remote host.
Dim receiveBytes As [Byte]() = udpClient.Recei ve(RemoteIpEndP oint)
Dim returnData As String = Encoding.ASCII. GetString(recei veBytes)

' Which one of these two hosts responded?
Console.WriteLi ne(("This is the message you received " + _
returnData.ToSt ring()))
Console.WriteLi ne(("This message was sent from " + _
RemoteIpEndPoin t.Address.ToStr ing() + _
" on their port number " + _
RemoteIpEndPoin t.Port.ToString ()))
udpClient.Close ()
udpClientB.Clos e()

Catch e As Exception
Console.WriteLi ne(e.ToString() )
End Try
End Sub
[C#]
// This constructor arbitrarily assigns the local port number.
UdpClient udpClient = new UdpClient();
try{
udpClient.Conne ct("www.contoso .com", 11000);

// Sends a message to the host to which you have connected.
Byte[] sendBytes = Encoding.ASCII. GetBytes("Is anybody there?");

udpClient.Send( sendBytes, sendBytes.Lengt h);

// Sends a message to a different host using optional hostname and port parameters.
UdpClient udpClientB = new UdpClient();
udpClientB.Send (sendBytes, sendBytes.Lengt h, "AlternateHostM achineName", 11000);

//IPEndPoint object will allow us to read datagrams sent from any source.
IPEndPoint RemoteIpEndPoin t = new IPEndPoint(IPAd dress.Any, 0);

// Blocks until a message returns on this socket from a remote host.
Byte[] receiveBytes = udpClient.Recei ve(ref RemoteIpEndPoin t);
string returnData = Encoding.ASCII. GetString(recei veBytes);

// Uses the IPEndPoint object to determine which of these two hosts responded.
Console.WriteLi ne("This is the message you received " +
returnData.ToSt ring());
Console.WriteLi ne("This message was sent from " +
RemoteIpEndPoin t.Address.ToStr ing() +
" on their port number " +
RemoteIpEndPoin t.Port.ToString ());

udpClient.Close ();
udpClientB.Clos e();

}
catch (Exception e ) {
Console.WriteLi ne(e.ToString() );
}
[C++]
// With this constructor the local port number is arbitrarily assigned.
UdpClient __gc *udpClient = new UdpClient();
try {
udpClient->Connect(S"host .contoso.com", 11000);

// Send message to the host to which you have connected.
Byte sendBytes __gc[] = Encoding::ASCII->GetBytes(S"I s anybody there?");

udpClient->Send(sendBytes , sendBytes->Length);

// Send message to a different host using optional hostname and port parameters.
UdpClient __gc *udpClientB = new UdpClient();
udpClientB->Send(sendBytes , sendBytes->Length, S"AlternateHost MachineName", 11000);

//IPEndPoint object will allow us to read datagrams sent from any source.
IPEndPoint __gc *RemoteIpEndPoi nt = new IPEndPoint(IPAd dress::Any, 0);

// Block until a message returns on this socket from a remote host.
Byte receiveBytes __gc[] = udpClient->Receive(&Remot eIpEndPoint);
String __gc *returnData = Encoding::ASCII->GetString(rece iveBytes);

// Use the IPEndPoint object to determine which of these two hosts responded.
Console::WriteL ine(String::Con cat(S"This is the message you received ", returnData->ToString())) ;
Console::WriteL ine(String::Con cat(S"This message was sent from ", RemoteIpEndPoin t->Address->ToString(),
S" on their port number ", __box(RemoteIpE ndPoint->Port)->ToString())) ;

udpClient->Close();
udpClientB->Close();

}
catch (Exception __gc *e ) {
Console::WriteL ine(e->ToString());
}
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button in the upper-left corner of the page.

Requirements
Namespace: System.Net.Sock ets

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: System (in System.dll)

..NET Framework Security:

a.. SocketPermissio n To establish an outgoing connection or accept an incoming request.
See Also
UdpClient Members | System.Net.Sock ets Namespace | TcpClient | TCP/UDP | UdpClient Members (Visual J# Syntax) | Managed Extensions for C++ Programming
Syntax based on .NET Framework version 1.1.
Documentation version 1.1.1.

"Jon Davis" <jo*@REMOVE.ME. jondavis.net> wrote in message news:OF******** ******@TK2MSFTN GP11.phx.gbl...
Isn't that illegal?

I know the linux platform lets you hack into the TCP/IP stack when using C++
to do this, but I would be very surprised if Microsoft didn't seal that door
shut in its Windows TCP/IP stack.

Then again, I do not know, so this is a non-answer.

Jon


"Laxmikant Rashinkar" <LK@televital.c om> wrote in message
news:ek******** ******@TK2MSFTN GP12.phx.gbl...
Is there any way to use a C# socket in promiscuous mode?
Any sample code that shows how this is done?

any assistance is much appreciated!
thanks
LK


Nov 16 '05 #3
Are you referring to UDP? Uh, please ignore previous post!! I was thinking
of something else (i.e. having sex with someone else's TCP socket).

Take a look at the UdpClient Class.

Jon

..NET Framework Class Library

UdpClient Class
See Also
UdpClient Members | System.Net.Sock ets Namespace | TcpClient | TCP/UDP |
UdpClient Members (Visual J# Syntax) | Managed Extensions for C++
Programming
Requirements
Namespace: System.Net.Sock ets
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows
2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003
family, .NET Compact Framework
Assembly: System (in System.dll)
..NET Framework Security:
SocketPermissio n To establish an outgoing connection or accept an incoming
request.
Language
C#

C++

JScript

Visual Basic

Show All
Provides User Datagram Protocol (UDP) network services.
For a list of all members of this type, see UdpClient Members.
System.Object
System.Net.Sock ets.UdpClient
[Visual Basic]
Public Class UdpClient
Implements IDisposable
[C#]
public class UdpClient : IDisposable
[C++]
public __gc class UdpClient : public IDisposable
[JScript]
public class UdpClient implements IDisposable
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread
safe. Any instance members are not guaranteed to be thread safe.
Remarks
The UdpClient class provides simple methods for sending and receiving
connectionless UDP datagrams in blocking synchronous mode. Because UDP is a
connectionless transport protocol, you do not need to establish a remote
host connection prior to sending and receiving data. You do, however, have
the option of establishing a default remote host in one of the following two
ways:
Create an instance of the UdpClient class using the remote host name and
port number as parameters.
Create an instance of the UdpClient class and then call the Connect method.
You can use any of the send methods provided in the UdpClient to send data
to a remote device. Use the Receive method to receive data from remote
hosts.
Note Do not call Send using a host name or IPEndPoint if you have already
specified a default remote host. If you do, UdpClient will throw an
exception.
UdpClient methods also allow you to send and receive multicasted datagrams.
Use The JoinMulticastGr oup method to subscribe a UdpClient to a multicast
group. Use the DropMulticastGr oup method to unsubscribe a UdpClient from a
multicast group.
Example
[Visual Basic, C#, C++] The following example establishes a UdpClient
connection using the host name www.contoso.com on port 11000. A small string
message is sent to two separate remote host machines. The Receive method
blocks execution until a message is received. Using the IPEndPoint passed to
Receive, the identity of the responding host is revealed.
[Visual Basic]
' This constructor arbitrarily assigns the local port number.
Dim udpClient As New UdpClient()
Try
udpClient.Conne ct("www.contoso .com", 11000)

' Sends a message to the host to which you have connected.
Dim sendBytes As [Byte]() = Encoding.ASCII. GetBytes("Is anybody there?")

udpClient.Send( sendBytes, sendBytes.Lengt h)

' Sends message to a different host using optional hostname and port
parameters.
Dim udpClientB As New UdpClient()
udpClientB.Send (sendBytes, sendBytes.Lengt h, "AlternateHostM achineName",
11000)

'Blocks until a message returns on this socket from a remote host.
Dim RemoteIpEndPoin t As New IPEndPoint(IPAd dress.Any, 0)

' Blocks until a message returns on this socket from a remote host.
Dim receiveBytes As [Byte]() = udpClient.Recei ve(RemoteIpEndP oint)
Dim returnData As String = Encoding.ASCII. GetString(recei veBytes)

' Which one of these two hosts responded?
Console.WriteLi ne(("This is the message you received " + _
returnData.ToSt ring()))
Console.WriteLi ne(("This message was sent from " + _
RemoteIpEndPoin t.Address.ToStr ing() + _
" on their port number " + _
RemoteIpEndPoin t.Port.ToString ()))
udpClient.Close ()
udpClientB.Clos e()

Catch e As Exception
Console.WriteLi ne(e.ToString() )
End Try
End Sub
[C#]
// This constructor arbitrarily assigns the local port number.
UdpClient udpClient = new UdpClient();
try{
udpClient.Conne ct("www.contoso .com", 11000);

// Sends a message to the host to which you have connected.
Byte[] sendBytes = Encoding.ASCII. GetBytes("Is anybody there?");

udpClient.Send( sendBytes, sendBytes.Lengt h);

// Sends a message to a different host using optional hostname and
port parameters.
UdpClient udpClientB = new UdpClient();
udpClientB.Send (sendBytes, sendBytes.Lengt h,
"AlternateHostM achineName", 11000);

//IPEndPoint object will allow us to read datagrams sent from any
source.
IPEndPoint RemoteIpEndPoin t = new IPEndPoint(IPAd dress.Any, 0);

// Blocks until a message returns on this socket from a remote
host.
Byte[] receiveBytes = udpClient.Recei ve(ref RemoteIpEndPoin t);
string returnData = Encoding.ASCII. GetString(recei veBytes);

// Uses the IPEndPoint object to determine which of these two hosts
responded.
Console.WriteLi ne("This is the message you received " +
returnData.ToSt ring());
Console.WriteLi ne("This message was sent from " +
RemoteIpEndPoin t.Address.ToStr ing() +
" on their port number " +
RemoteIpEndPoin t.Port.ToString ());

udpClient.Close ();
udpClientB.Clos e();

}
catch (Exception e ) {
Console.WriteLi ne(e.ToString() );
}
[C++]
// With this constructor the local port number is arbitrarily assigned.
UdpClient __gc *udpClient = new UdpClient();
try {
udpClient->Connect(S"host .contoso.com", 11000);

// Send message to the host to which you have connected.
Byte sendBytes __gc[] = Encoding::ASCII->GetBytes(S"I s anybody there?");

udpClient->Send(sendBytes , sendBytes->Length);

// Send message to a different host using optional hostname and port
parameters.
UdpClient __gc *udpClientB = new UdpClient();
udpClientB->Send(sendBytes , sendBytes->Length,
S"AlternateHost MachineName", 11000);

//IPEndPoint object will allow us to read datagrams sent from any
source.
IPEndPoint __gc *RemoteIpEndPoi nt = new IPEndPoint(IPAd dress::Any, 0);

// Block until a message returns on this socket from a remote host.
Byte receiveBytes __gc[] = udpClient->Receive(&Remot eIpEndPoint);
String __gc *returnData = Encoding::ASCII->GetString(rece iveBytes);

// Use the IPEndPoint object to determine which of these two hosts
responded.
Console::WriteL ine(String::Con cat(S"This is the message you received ",
returnData->ToString())) ;
Console::WriteL ine(String::Con cat(S"This message was sent from ",
RemoteIpEndPoin t->Address->ToString(),
S" on their port number ",
__box(RemoteIpE ndPoint->Port)->ToString())) ;

udpClient->Close();
udpClientB->Close();

}
catch (Exception __gc *e ) {
Console::WriteL ine(e->ToString());
}
[JScript] No example is available for JScript. To view a Visual Basic, C#,
or C++ example, click the Language Filter button in the upper-left corner
of the page.
Requirements
Namespace: System.Net.Sock ets
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows
2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003
family, .NET Compact Framework
Assembly: System (in System.dll)
..NET Framework Security:
SocketPermissio n To establish an outgoing connection or accept an incoming
request.
See Also
UdpClient Members | System.Net.Sock ets Namespace | TcpClient | TCP/UDP |
UdpClient Members (Visual J# Syntax) | Managed Extensions for C++
Programming
Syntax based on .NET Framework version 1.1.
Documentation version 1.1.1.
Nov 16 '05 #4
Are you referring to UDP? Uh, please ignore previous post!! I was thinking
of something else (i.e. doing the nasty with someone else's TCP socket).

Take a look at the UdpClient Class.

Jon

..NET Framework Class Library

UdpClient Class
See Also
UdpClient Members | System.Net.Sock ets Namespace | TcpClient | TCP/UDP |
UdpClient Members (Visual J# Syntax) | Managed Extensions for C++
Programming
Requirements
Namespace: System.Net.Sock ets
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows
2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003
family, .NET Compact Framework
Assembly: System (in System.dll)
..NET Framework Security:
SocketPermissio n To establish an outgoing connection or accept an incoming
request.
Language
C#

C++

JScript

Visual Basic

Show All
Provides User Datagram Protocol (UDP) network services.
For a list of all members of this type, see UdpClient Members.
System.Object
System.Net.Sock ets.UdpClient
[Visual Basic]
Public Class UdpClient
Implements IDisposable
[C#]
public class UdpClient : IDisposable
[C++]
public __gc class UdpClient : public IDisposable
[JScript]
public class UdpClient implements IDisposable
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread
safe. Any instance members are not guaranteed to be thread safe.
Remarks
The UdpClient class provides simple methods for sending and receiving
connectionless UDP datagrams in blocking synchronous mode. Because UDP is a
connectionless transport protocol, you do not need to establish a remote
host connection prior to sending and receiving data. You do, however, have
the option of establishing a default remote host in one of the following two
ways:
Create an instance of the UdpClient class using the remote host name and
port number as parameters.
Create an instance of the UdpClient class and then call the Connect method.
You can use any of the send methods provided in the UdpClient to send data
to a remote device. Use the Receive method to receive data from remote
hosts.
Note Do not call Send using a host name or IPEndPoint if you have already
specified a default remote host. If you do, UdpClient will throw an
exception.
UdpClient methods also allow you to send and receive multicasted datagrams.
Use The JoinMulticastGr oup method to subscribe a UdpClient to a multicast
group. Use the DropMulticastGr oup method to unsubscribe a UdpClient from a
multicast group.
Example
[Visual Basic, C#, C++] The following example establishes a UdpClient
connection using the host name www.contoso.com on port 11000. A small string
message is sent to two separate remote host machines. The Receive method
blocks execution until a message is received. Using the IPEndPoint passed to
Receive, the identity of the responding host is revealed.
[Visual Basic]
' This constructor arbitrarily assigns the local port number.
Dim udpClient As New UdpClient()
Try
udpClient.Conne ct("www.contoso .com", 11000)

' Sends a message to the host to which you have connected.
Dim sendBytes As [Byte]() = Encoding.ASCII. GetBytes("Is anybody there?")

udpClient.Send( sendBytes, sendBytes.Lengt h)

' Sends message to a different host using optional hostname and port
parameters.
Dim udpClientB As New UdpClient()
udpClientB.Send (sendBytes, sendBytes.Lengt h, "AlternateHostM achineName",
11000)

'Blocks until a message returns on this socket from a remote host.
Dim RemoteIpEndPoin t As New IPEndPoint(IPAd dress.Any, 0)

' Blocks until a message returns on this socket from a remote host.
Dim receiveBytes As [Byte]() = udpClient.Recei ve(RemoteIpEndP oint)
Dim returnData As String = Encoding.ASCII. GetString(recei veBytes)

' Which one of these two hosts responded?
Console.WriteLi ne(("This is the message you received " + _
returnData.ToSt ring()))
Console.WriteLi ne(("This message was sent from " + _
RemoteIpEndPoin t.Address.ToStr ing() + _
" on their port number " + _
RemoteIpEndPoin t.Port.ToString ()))
udpClient.Close ()
udpClientB.Clos e()

Catch e As Exception
Console.WriteLi ne(e.ToString() )
End Try
End Sub
[C#]
// This constructor arbitrarily assigns the local port number.
UdpClient udpClient = new UdpClient();
try{
udpClient.Conne ct("www.contoso .com", 11000);

// Sends a message to the host to which you have connected.
Byte[] sendBytes = Encoding.ASCII. GetBytes("Is anybody there?");

udpClient.Send( sendBytes, sendBytes.Lengt h);

// Sends a message to a different host using optional hostname and
port parameters.
UdpClient udpClientB = new UdpClient();
udpClientB.Send (sendBytes, sendBytes.Lengt h,
"AlternateHostM achineName", 11000);

//IPEndPoint object will allow us to read datagrams sent from any
source.
IPEndPoint RemoteIpEndPoin t = new IPEndPoint(IPAd dress.Any, 0);

// Blocks until a message returns on this socket from a remote
host.
Byte[] receiveBytes = udpClient.Recei ve(ref RemoteIpEndPoin t);
string returnData = Encoding.ASCII. GetString(recei veBytes);

// Uses the IPEndPoint object to determine which of these two hosts
responded.
Console.WriteLi ne("This is the message you received " +
returnData.ToSt ring());
Console.WriteLi ne("This message was sent from " +
RemoteIpEndPoin t.Address.ToStr ing() +
" on their port number " +
RemoteIpEndPoin t.Port.ToString ());

udpClient.Close ();
udpClientB.Clos e();

}
catch (Exception e ) {
Console.WriteLi ne(e.ToString() );
}
[C++]
// With this constructor the local port number is arbitrarily assigned.
UdpClient __gc *udpClient = new UdpClient();
try {
udpClient->Connect(S"host .contoso.com", 11000);

// Send message to the host to which you have connected.
Byte sendBytes __gc[] = Encoding::ASCII->GetBytes(S"I s anybody there?");

udpClient->Send(sendBytes , sendBytes->Length);

// Send message to a different host using optional hostname and port
parameters.
UdpClient __gc *udpClientB = new UdpClient();
udpClientB->Send(sendBytes , sendBytes->Length,
S"AlternateHost MachineName", 11000);

//IPEndPoint object will allow us to read datagrams sent from any
source.
IPEndPoint __gc *RemoteIpEndPoi nt = new IPEndPoint(IPAd dress::Any, 0);

// Block until a message returns on this socket from a remote host.
Byte receiveBytes __gc[] = udpClient->Receive(&Remot eIpEndPoint);
String __gc *returnData = Encoding::ASCII->GetString(rece iveBytes);

// Use the IPEndPoint object to determine which of these two hosts
responded.
Console::WriteL ine(String::Con cat(S"This is the message you received ",
returnData->ToString())) ;
Console::WriteL ine(String::Con cat(S"This message was sent from ",
RemoteIpEndPoin t->Address->ToString(),
S" on their port number ",
__box(RemoteIpE ndPoint->Port)->ToString())) ;

udpClient->Close();
udpClientB->Close();

}
catch (Exception __gc *e ) {
Console::WriteL ine(e->ToString());
}
[JScript] No example is available for JScript. To view a Visual Basic, C#,
or C++ example, click the Language Filter button in the upper-left corner
of the page.
Requirements
Namespace: System.Net.Sock ets
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows
2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003
family, .NET Compact Framework
Assembly: System (in System.dll)
..NET Framework Security:
SocketPermissio n To establish an outgoing connection or accept an incoming
request.
See Also
UdpClient Members | System.Net.Sock ets Namespace | TcpClient | TCP/UDP |
UdpClient Members (Visual J# Syntax) | Managed Extensions for C++
Programming
Syntax based on .NET Framework version 1.1.
Documentation version 1.1.1.

Nov 16 '05 #5
"Laxmikant Rashinkar" <LK@televital.c om> wrote in message
news:ek******** ******@TK2MSFTN GP12.phx.gbl...
Is there any way to use a C# socket in promiscuous mode?
Any sample code that shows how this is done?


I don't know what "promiscuou s mode" is, but one can open a socket in "raw
mode" with C++.
Nov 16 '05 #6
"Laxmikant Rashinkar" <LK@televital.c om> wrote in message
news:ek******** ******@TK2MSFTN GP12.phx.gbl...
Is there any way to use a C# socket in promiscuous mode?
Any sample code that shows how this is done?


I don't know what "promiscuou s mode" is, but one can open a socket in "raw
mode" with C++.
Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3894
by: Tero Saarni | last post by:
Hi, I have several threads communicating with each other using events stored in Queues. Threads block on Queue.get() until somebody publishes an event in thread's event queue. I need to add support for sockets to the system. Thread needs to unblock when: - there is socket ready to be read, or
1
3795
by: Dmitry Akselrod | last post by:
Hello everyone, I have a vb.net application that wraps the TCPListener object in a class. The server connects to the local interface and establishes itself on port 9900. It then polls for pending connections every 500ms. I also have a vb6 application that uses the WinSock control at the other end of the communication tunel. I have to work with vb6 here because it uses less memory than .NET.
0
1875
by: armsby | last post by:
do anybody have any experience with promiscuous mode i need to put my solaris in promiscuous mode so i can log and analyse it
4
6321
by: BadOmen | last post by:
Hi, What is the different between 'System.Net.Sockets.Socket' and 'System.Net.Sockets.TcpClient'? When do I use System.Net.Sockets.TcpClient and System.Net.Sockets.Socket?? Yours, Jonas
3
4363
by: Michael Maercker | last post by:
hi! i'm really not into networking at all and have now been asigned the task of porting a vb6-code into vb.net (compact framework, in this case) and the code uses the winsock-control. i quickly found out that .net uses system.net.sockets.socket or .tcpclient/.tcpserver. and these confuse me... :o| and help would be really great! links, code, wrappers, tips, whateveryougot... one of my main problems, i guess, is: why don't sockets...
3
11593
by: J C | last post by:
Hi, I'm using UDPClient to make a simple DNS server. I notice that intermittently and unpredictibly I get: Unhandled Exception: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.ReceiveFrom(Byte buffer, Int32 offset, Int32 s
1
11072
by: kardon33 | last post by:
Hello all, I am trying to write a C program on Unix (OpenBSD 4.3) that will be sniffing a certain packet which is being sent by a diff rent machine to another different machine. The only way I believe this is possible is to set my NIC into promiscuous mode. I would like to set the NIC to Promiscuous mode in my C program but I would also be content if anyone knows a way to just set it in that mode permanently, but thats more of a...
7
6723
by: Adam01 | last post by:
Im using cygwin to test the code of a server I am writing. I've included sys/types.h, sys/socket.h, netdb.h, and arpa/inet.h. And this is the output.. ../../../sockets.cpp: In constructor `network_class::network_class()': ../../../sockets.cpp:64: error: aggregate `addrinfo hints' has incomplete type a nd cannot be defined ../../../sockets.cpp:69: error: `getaddrinfo' undeclared (first use this functio n)
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7461
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4009
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.