Re: getting client ip in sock-client on server
- From: v-terryf@xxxxxxxxxxxxxxxxxxxx ("TerryFei")
- Date: Fri, 20 Jan 2006 03:22:28 GMT
Hi Ankit,
In this current situation, I suggest you could try to invoke getpeername /
getsockname using PInvoke mechanism. On a connected socket, getpeername
will give you the remote address and getsockname will give you the local
address for the connection. We could use Socket.Handle Property to get the
socket handle and pass it into these API as parameters.
I hope the above inforamtion is helpful for you.If you have any questions
or concerns, please let me know. Thanks again and have a nice day!
Best Regards,
Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Best Regards,
--------------------
>From: "Ankit Aneja" <efextra@xxxxxxxxxxxxxxxxx>
>References: <uqUvfKOHGHA.2696@xxxxxxxxxxxxxxxxxxxx>
<dqntbf$179$1@xxxxxxxxxxxxxx> <Oz2fl8OHGHA.2212@xxxxxxxxxxxxxxxxxxxx>
<e0kaciPHGHA.1760@xxxxxxxxxxxxxxxxxxxx>
>Subject: Re: getting client ip in sock-client on server
>Date: Thu, 19 Jan 2006 19:18:12 +0530
>Lines: 30
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
>X-RFC2646: Format=Flowed; Original
>Message-ID: <OxE6AAQHGHA.3624@xxxxxxxxxxxxxxxxxxxx>
>Newsgroups: microsoft.public.dotnet.languages.csharp
>NNTP-Posting-Host: dsl-del-dynamic-067.85.246.61.touchtelindia.net
61.246.85.67
>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
>Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.languages.csharp:379684
>X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
>
>
>No, it won't. I can't find anything in TcpClient documentation (fw 1.1)
>class that would reveal client's IP address (but I may be wrong here)
>
>can i get it using framework 2.0
>pls help
>
>
>
>
>"Goran Sliskovic" <gsliskov@xxxxxxxxx> wrote in message
>news:e0kaciPHGHA.1760@xxxxxxxxxxxxxxxxxxxxxxx
>>
>> "Ankit Aneja" <efextra@xxxxxxxxxxxxxxxxx> wrote in message
>> news:Oz2fl8OHGHA.2212@xxxxxxxxxxxxxxxxxxxxxxx
>>> will it give ip address of client
>>> i want to fetch ip address on server of client which is accepted or
>>> connected
>> ...
>>
>> No, it won't. I can't find anything in TcpClient documentation (fw 1.1)
>> class that would reveal client's IP address (but I may be wrong here) .
If
>> you can use Socket class, then you can use RemoteEndPoint property.
>>
>> Regards,
>> Goran
>>
>>
>
>
>
.
- References:
- getting client ip in sock-client on server
- From: Ankit Aneja
- Re: getting client ip in sock-client on server
- From: Marko Becirevic
- Re: getting client ip in sock-client on server
- From: Ankit Aneja
- Re: getting client ip in sock-client on server
- From: Goran Sliskovic
- Re: getting client ip in sock-client on server
- From: Ankit Aneja
- getting client ip in sock-client on server
- Prev by Date: Re: get client ip address in C# socket client application
- Next by Date: Memberwise assignment of an object.
- Previous by thread: Re: getting client ip in sock-client on server
- Next by thread: Re: getting client ip in sock-client on server
- Index(es):
Relevant Pages
|