Click here to Skip to main content
15,891,943 members
Home / Discussions / C#
   

C#

 
GeneralRun another console application in my console application Pin
eggie529-Jun-05 13:08
eggie529-Jun-05 13:08 
GeneralRe: Run another console application in my console application Pin
Matt Gerrans29-Jun-05 14:37
Matt Gerrans29-Jun-05 14:37 
GeneralRe: Run another console application in my console application Pin
eggie530-Jun-05 6:51
eggie530-Jun-05 6:51 
GeneralRe: Run another console application in my console application Pin
leppie30-Jun-05 7:45
leppie30-Jun-05 7:45 
GeneralRe: Run another console application in my console application Pin
Matt Gerrans30-Jun-05 7:55
Matt Gerrans30-Jun-05 7:55 
GeneralFullRowSelect in DataGrid Pin
Jassim Rahma29-Jun-05 11:52
Jassim Rahma29-Jun-05 11:52 
GeneralRe: FullRowSelect in DataGrid Pin
Hugo Migneron30-Jun-05 3:09
Hugo Migneron30-Jun-05 3:09 
GeneralHeader information in UDP Packet Pin
Hugo Migneron29-Jun-05 9:36
Hugo Migneron29-Jun-05 9:36 
Hello,
I am using UDP protocol to broadcast a packet on the network. After I send this packet, some devices on the network answer with a UDP datagram packet containing some information.

My problem is that whenever one of these devices answer, (I know I get the packet because the Socket.Receive function returns me the data I am waiting for) I don't know who this packet is coming from. I am looking for a way to know the IP Address of the packet sender.

This is my code :

<br />
IPEndPoint Broadcast = new IPEndPoint(IP, 2000);<br />
EndPoint BroadcastEP = (EndPoint)Broadcast;<br />
<br />
socket = new Socket(System.Net.Sockets.AddressFamily.InterNetwork,<br />
	SocketType.Dgram, ProtocolType.Udp);<br />
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);<br />
//msg is a byte[] that contains the data<br />
socket.SendTo(msg, 0, msg.Length, SocketFlags.None, BroadcastEP);<br />


Then, if I use the socket.Receive function, I get the payload of the packet but not the header information. Is there a way to get this information (Source's IP Address) with System.Net.Sockets or with System.Net.Sockets.UpdClient ?
I thought I could get this information by using socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.PacketInformation, ... but I just can't seem to figure out how to use it correctly.

If anyone knows how to do this, it would be greatly appreciated!


Hugo Migneron
Generalrunning g++ using process.start Pin
thepersonof29-Jun-05 8:31
thepersonof29-Jun-05 8:31 
GeneralRe: running g++ using process.start Pin
Judah Gabriel Himango29-Jun-05 8:44
sponsorJudah Gabriel Himango29-Jun-05 8:44 
GeneralRe: running g++ using process.start Pin
S. Senthil Kumar29-Jun-05 9:02
S. Senthil Kumar29-Jun-05 9:02 
GeneralRe: running g++ using process.start Pin
S. Senthil Kumar29-Jun-05 9:01
S. Senthil Kumar29-Jun-05 9:01 
GeneralRe: running g++ using process.start Pin
thepersonof29-Jun-05 9:54
thepersonof29-Jun-05 9:54 
GeneralRe: running g++ using process.start Pin
S. Senthil Kumar29-Jun-05 11:45
S. Senthil Kumar29-Jun-05 11:45 
GeneralRe: running g++ using process.start Pin
Matt Gerrans29-Jun-05 14:41
Matt Gerrans29-Jun-05 14:41 
GeneralRe: running g++ using process.start Pin
Matt Gerrans29-Jun-05 14:42
Matt Gerrans29-Jun-05 14:42 
GeneralRe: context menu does not pop up Pin
Judah Gabriel Himango29-Jun-05 8:45
sponsorJudah Gabriel Himango29-Jun-05 8:45 
Generaluser control Collection Editor with Control on Form Pin
CiNN29-Jun-05 7:58
CiNN29-Jun-05 7:58 
GeneralInternet Explorer-style Menu Bar in C# Pin
tekun29-Jun-05 7:17
tekun29-Jun-05 7:17 
GeneralListview scroll visible event Pin
machocr29-Jun-05 6:44
machocr29-Jun-05 6:44 
GeneralCrystal report Pin
ShahYatin29-Jun-05 6:31
ShahYatin29-Jun-05 6:31 
GeneralPocket PC 'Ok' button Pin
george ivanov29-Jun-05 4:01
george ivanov29-Jun-05 4:01 
Generalhelp me to display a form Pin
os58629-Jun-05 3:55
os58629-Jun-05 3:55 
GeneralRe: help me to display a form Pin
Not Active29-Jun-05 4:18
mentorNot Active29-Jun-05 4:18 
GeneralRe: help me to display a form Pin
Piovra_29-Jun-05 4:39
Piovra_29-Jun-05 4:39 

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.