473,408 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How to validate the URL ?

Hi Friends,

I am developing application based on .net Remoting. In my client
application i have accessed the remote object by Activator.GetObject
function. In this GetObject function, i have passed the second argument
as URL, like "tcp://localhost:8384/Container". From my client program
how can i validate this URL ? i.e., before using this url i need to
identify whether any service is published on this URL or not. Please
help me to solve this issue.

Regards,
Prakash.

Dec 14 '05 #1
1 3094
You can use various "ping" methods to see if the ip address exists but that
won't tell you if the server process is running. You can implement an
interface on your remote objects that expose an IsAlive method that returns
a boolean. You would need to provide a handler for this interface on the
client but that could be done with a helper object that serves as a client
"object server". For instance:

client:

RemoteObj remobj=(RemoteObj)RemoteHelper.GetObject(RemoteTyp e);

Remote Object Helper:

class RemoteHelper
{
public object GetObject(type RemoteType)
{
// you can put this code in a loop and loop until you have an Alive
object.
string URL=[Get a possible url from a config file or whatever]
IIsAlive obj=(IIsAlive)Activator.GetObject(RemoteType, URL);
try
{
bool bolIsAlive=obj.IsAlive();
}
catch(Exception ex)
{
Debug.WriteLine("Object is not alive");
}

}
}

IIsAlive interface

public interface IIsAlive
{
bool IsAlive();
}

Have all your remote objects implement the IIsAlive interface. You can then
have a list of possible urls available at the client so the RemoteHelper can
return an appropriate object.

This is not the most efficient plan but it will serve the purpose.

-chris

"Prakash" <p.************@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi Friends,

I am developing application based on .net Remoting. In my client
application i have accessed the remote object by Activator.GetObject
function. In this GetObject function, i have passed the second argument
as URL, like "tcp://localhost:8384/Container". From my client program
how can i validate this URL ? i.e., before using this url i need to
identify whether any service is published on this URL or not. Please
help me to solve this issue.

Regards,
Prakash.

Dec 14 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: SHC | last post by:
Hi all, I have a VC++ .NET 2003 - Windows XP Pro PC. I created a Win32 console application in my VC++ .NET 2003 and copied validateDOM.cpp, books.xml and books.xsd (see the attached files below)...
5
by: Jim Heavey | last post by:
When should you use the Page.Validate() method? I thought you would use this method if you have some Server side validation (CustomControl's) you wanted to use and this would cause them to be...
11
by: jjbutera | last post by:
I know how to use the ErrorProvider in my winforms..or do I? I validate the values and set the ErrorProvider in the validating event. If not valid, I set e.Cancel = True. I clear the ErrorProvider...
0
by: Marc Scheuner | last post by:
Folks, I'm faced with a dilemma here - I have an XML document and for part of it, I have an XSD schema to validate it - but not for the rest of it. Can I still validate at least part of the...
4
by: Brybot | last post by:
I have a form that i've split up into multiple asp:panels, each panel has a number of validators which work correctly. At on the last panel, i want to commit the data collected to a database. I...
24
by: Mike Hofer | last post by:
Please forgive the cross-post to multiple forums. I did it intentionally, but I *think* it was appropriate given the nature of my question. I'm working on an open source code library to help...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.