Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
How can I find a client's IP connected to my server (using a TCP socket)?

This is only a test of the emergency broadcast system

This is a product of hysterical mass confusion

A ship of fools adrift on the sea of our pollution

Rudderless and powerless on the sea of our delusion

pennywise - this is only a test

Posted

s.Connect(lep);

 

// Using the LocalEndPoint property.

Console.WriteLine("My local IpAddress is :" + IPAddress.Parse(((IPEndPoint)s.LocalEndPoint).Address.ToString()) +

"I am connected on port number " + ((IPEndPoint)s.LocalEndPoint).Port.ToString());

 

Straight out of MSDN. I am assuming you are using C#, but regardless of that your answer is in MSDN.

Posted

I'm using vb; I can never find what I'm looking for on MSDN. I used the top line of the code to search and found the vb version.

 

Thanks! :)

This is only a test of the emergency broadcast system

This is a product of hysterical mass confusion

A ship of fools adrift on the sea of our pollution

Rudderless and powerless on the sea of our delusion

pennywise - this is only a test

Posted
Hmm, it seems to be that way for a lot of people. You just have to think of keywords. In this case, looking up 'Socket' in the index will give you everything that you need. I think that it should be a similar process in VB .NET as in C#. Good luck

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...