Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 22nd, 2004, 10:01 AM
Registered User
 
Join Date: Aug 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default HttpHandler, TCP Port ?

Hi everyone,
I have a HttpHandler in wich I need to know the tcp source port of the request. As much as I figured out I need to access the HttpWorkerRequest.GetRemotePort() .
I made several attempts but everytime it returns 0.

first try:

void IHttpHandler.ProcessRequest(HttpContext context)
{
BindingFlags _WorkerBinding =BindingFlags.Instance|BindingFlags.Public|Binding Flags.NonPublic;
HttpWorkerRequest _WorkerRequest = (HttpWorkerRequest)
context.GetType().GetProperty("WorkerRequest",
_WorkerBinding).GetValue(context, null);

int _ReqTcpPort = _WorkerRequest.GetRemotePort();
...
}

second try:

void IHttpHandler.ProcessRequest(HttpContext context)
{
IServiceProvider _Provider = (IServiceProvider) context;
HttpWorkerRequest _WorkerRequest =
(HttpWorkerRequest) _Provider.GetService(typeof(HttpWorkerRequest));

int _ReqTcpPort = _WorkerRequest.GetRemotePort();
...
}

how can I get access to the properties (tcp source port) of the underlying connection ???

thanks in advance,

Martin
 
Old August 22nd, 2004, 10:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Doesn't look like classic ASP related. Should that be posted in a relavant forum?

_________________________
- Vijay G
Strive for Perfection
 
Old August 22nd, 2004, 10:30 AM
Registered User
 
Join Date: Aug 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you know one where someone can help me better :)

 
Old August 22nd, 2004, 10:36 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

If .Net related, you can choose the best fit from this category Dotnet

If C# related, you post on the best fit forum under this category C

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old August 22nd, 2004, 11:07 AM
Registered User
 
Join Date: Aug 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you, follow up:

http://p2p.wrox.com/topic.asp?TOPIC_ID=17968






Similar Threads
Thread Thread Starter Forum Replies Last Post
access of Items[""] collection in Httphandler anujrathi ASP.NET 2.0 Professional 0 November 15th, 2007 08:02 AM
Maximum limit for a TCP/IP Port ashu_from_india General .NET 2 April 20th, 2006 12:15 AM
TCP/IP HELP jpsultana VB.NET 2002/2003 Basics 0 September 29th, 2005 01:37 PM
HttpHandler, TCP Port ? dotnetMe General .NET 0 August 22nd, 2004 11:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.