Click here to Skip to main content
15,896,118 members
Home / Discussions / C#
   

C#

 
GeneralRe: copying feature from Mac OS X Tiger Pin
Luis Alonso Ramos30-Apr-05 15:36
Luis Alonso Ramos30-Apr-05 15:36 
GeneralRe: copying feature from Mac OS X Tiger Pin
ekynox1-May-05 3:33
ekynox1-May-05 3:33 
GeneralDeveloping On Pin
MrJJKoolJ30-Apr-05 3:27
MrJJKoolJ30-Apr-05 3:27 
GeneralRe: Developing On Pin
Dave Kreskowiak30-Apr-05 3:59
mveDave Kreskowiak30-Apr-05 3:59 
GeneralRe: Developing On Pin
MrJJKoolJ30-Apr-05 6:09
MrJJKoolJ30-Apr-05 6:09 
GeneralUsing a mouse-offset in a Picture Box Pin
NortonC30-Apr-05 1:57
NortonC30-Apr-05 1:57 
GeneralRe: Using a mouse-offset in a Picture Box Pin
NortonC30-Apr-05 7:21
NortonC30-Apr-05 7:21 
Questionhow to bring pointer to the beginning of file(streamreader) Pin
ashu_sharma2129-Apr-05 20:54
ashu_sharma2129-Apr-05 20:54 
AnswerRe: how to bring pointer to the beginning of file(streamreader) Pin
mav.northwind29-Apr-05 21:09
mav.northwind29-Apr-05 21:09 
GeneralA problem displaying transparant-background images in DirectX Pin
arik_a29-Apr-05 20:24
arik_a29-Apr-05 20:24 
General.NET WebService Problem Pin
Praveen Nayak29-Apr-05 19:51
Praveen Nayak29-Apr-05 19:51 
GeneralSystemtray capture Pin
dubshell29-Apr-05 19:47
dubshell29-Apr-05 19:47 
Generalusb interfacing in c#.net Pin
ahsan14129-Apr-05 18:49
ahsan14129-Apr-05 18:49 
GeneralRe: usb interfacing in c#.net Pin
eggie529-Apr-05 20:31
eggie529-Apr-05 20:31 
GeneralAcessing Usb Device in C# Pin
majidbhutta29-Apr-05 17:28
majidbhutta29-Apr-05 17:28 
GeneralRe: Acessing Usb Device in C# Pin
eggie529-Apr-05 20:33
eggie529-Apr-05 20:33 
GeneralRe: Acessing Usb Device in C# Pin
Dave Kreskowiak30-Apr-05 3:38
mveDave Kreskowiak30-Apr-05 3:38 
GeneralRe: Acessing Usb Device in C# Pin
Luis Alonso Ramos30-Apr-05 8:31
Luis Alonso Ramos30-Apr-05 8:31 
GeneralSocket.LocalEndPoint is not returning expected value. Pin
johtib29-Apr-05 13:19
johtib29-Apr-05 13:19 
I'm trying to bind my socket to any local network address and to port 1337 to listen to incomming broadcasts on that port.

Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true);
socket.Bind(new IPEndPoint(IPAddress.Any, 1337));


MSDN says:

"Before calling Bind, you must first create the local IPEndPoint from which you intend to communicate data. If you do not care which local address is assigned, you can create an IPEndPoint using IPAddress.Any as the address parameter, and the underlying service provider will assign the most appropriate network address. This might help simplify your application if you have multiple network interfaces. If you do not care which local port is used, you can create an IPEndPoint using 0 for the port number. In this case, the service provider will assign an available port number between 1024 and 5000.

If you use the above approach, you can discover what local network address and port number has been assigned by calling the LocalEndPoint. If you are using a connection-oriented protocol, LocalEndPoint will not return the locally assigned network address until after you have made a call to the Connect or EndConnect method. If you are using a connectionless protocol, you will not have access to this information until you have completed a send or receive."

IPEndPoint localhost = (IPEndPoint) socket.LocalEndPoint;
Console.WriteLine("LocalEndPoint: {0}", localhost.Address);


Prints: "LocalEndPoint: 0.0.0.0" but by sniffing the NIC (using Ethereal) I can see that packets sent using socket.SendTo(sendBuf, new IPEndPoint(IPAddress.Broadcast, 1337)); originates from the IP 192.168.0.100 (my machine's WLAN NIC). Why isn't this IP address reported by socket.LocalEndPoint? I need to know the address assigned!
GeneralRe: Socket.LocalEndPoint is not returning expected value. Pin
EssOEss30-Apr-05 19:55
EssOEss30-Apr-05 19:55 
GeneralRe: Socket.LocalEndPoint is not returning expected value. Pin
johtib30-Apr-05 22:37
johtib30-Apr-05 22:37 
GeneralRe: Socket.LocalEndPoint is not returning expected value. Pin
EssOEss1-May-05 0:44
EssOEss1-May-05 0:44 
GeneralThis is very strange... Pin
Nick Z.29-Apr-05 12:41
Nick Z.29-Apr-05 12:41 
GeneralRe: This is very strange... Pin
Nick Z.29-Apr-05 15:01
Nick Z.29-Apr-05 15:01 
QuestionManagement namespace a member of System? Pin
CTaylor8929-Apr-05 10:32
CTaylor8929-Apr-05 10:32 

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.