CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2003
    Location
    Corvallis, OR
    Posts
    315

    handle connection attempt

    I have a webservice written in c#. I simply want to handle (intercept) all connection attempts in order to validate the client IP.

    How do you handle a connection attempt in a webservice?

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto
    Posts
    805

    Re: handle connection attempt

    you generally wrap the connection in a try / catch block. That way you can thow or ignore any errors. And you can put your ip validation method in the try part and if it fails you can throw it to the catch part.

    hth,
    mcm
    rate my posts!
    mcm

  3. #3
    Join Date
    May 2003
    Location
    Corvallis, OR
    Posts
    315

    Re: handle connection attempt

    Ok. That's good, but how do I even detect that there is a connection attempt. Something like...
    Code:
    myService.OnConnection += new ConnectionHandler(handleConnect);
    
    private void handleConnect()
    {
      //handle connection here
    }
    So how do you intercept a connection attempt? Where does it come from?

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto
    Posts
    805

    Re: handle connection attempt

    rate my posts!
    mcm

  5. #5
    Join Date
    May 2003
    Location
    Corvallis, OR
    Posts
    315

    Re: handle connection attempt

    I'm curious how people out there handle connection attempts to the webservices. Certainly there must be some way to intercept a connection request and either allow or deny? Right?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured