473,387 Members | 1,542 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,387 software developers and data experts.

Remoting , services and objects design problem

Sorry about the length of this post but I felt it was better to show all the
details in order to get some resolution.
I have the following senario:
- a service which hosts objects for remoting they are defined as shown
below

Dim chan As TcpChannel
chan = New TcpChannel(52001)
ChannelServices.RegisterChannel(chan)
RemotingConfiguration.RegisterWellKnownServiceType (Type.GetType("ChatLibrary
..ChatManager,ChatLibrary"), "ChatServer", WellKnownObjectMode.Singleton)

'RemotingConfiguration.RegisterWellKnownServiceTyp e(Type.GetType("ChatLibrar
y.ChatUser,ChatLibrary"), "ChatServer", WellKnownObjectMode.Singleton)

- note that the second register is commented out since only one object can
be defined it seems.

- ok I will make that object a factory so that it can provide objects with
functions to return those objects

- now to attempt to use the objects
Try
ChannelServices.RegisterChannel(chan)
Catch ex As Exception
Exit Sub
End Try
Try
chatObject =
CType(Activator.GetObject(Type.GetType("ChatLibrar y.ChatManager,
ChatLibrary"), "tcp://localhost:52001/ChatServer"), ChatLibrary.ChatManager)
If chatObject Is Nothing Then
MsgBox("Service does not seem to up and running")

This does not happen unless I forget to start the service.

Else
Try
Dim poUser As ChatUser
Dim pocm As ChatMessage
pocm = chatObject.GetMessage
MsgBox(pocm.MsgSender)

This method show the dummy string I put into the function
poUser = chatObject.GetNewUser

Now debugging shows a proxy object for poUser

MsgBox(CStr(poUser.IsLoggedOn))

The above line shows the dummy value I have provided.
chatObject.Logon(poUser)

This is the line that gives the error. It indicates an internal error in
the service. I guess the question is can remoting serve more than one
object. That seems to be true since all the objects created seem to exist.
The problem is in using the object as a parameter.

Catch ex As Exception
MsgBox(ex.message)
End Try
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
The following is the definition of the "manager/factory" object and the
function that returns the ChatUser object.

Public Class ChatManager
Inherits MarshalByRefObject

Public Function GetNewUser() As ChatUser
Dim poUser As New ChatUser
Return poUser
End Function
The following is the definition of the object that I want to use as a
paramter.

Public Class ChatUser
Inherits MarshalByRefObject

Property IsLoggedOn() As Boolean
Get
Return mbLoggedOn
End Get
Set(ByVal Value As Boolean)
mbLoggedOn = Value
End Set
End Property
Any ideas?
Lloyd Sheen
Jul 21 '05 #1
0 877

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

Similar topics

2
by: Picho | last post by:
Hi group, this issue has been brought up a few times now. I am starting to design a client-server application. I do not see any x-platform activity in the future of my application. I...
3
by: Lucas Tam | last post by:
Does anyone have a good articles that describes the pros and cons of Web Services vs. Remoting Hosted in IIS? Is there a reason to use either or? With Remoting Hosting in IIS, is it possible...
1
by: SB | last post by:
Is it possible (or common practice) to have the business facade layer of the web services layer implemented as .net remoting component(s). While the web services provide the necssary access to...
13
by: Ron L | last post by:
I am working on an application that is a front-end for a SQL database. While it is not an immediate requirement, the application will probably be required to be able to connect via the internet at...
0
by: Lloyd Sheen | last post by:
Sorry about the length of this post but I felt it was better to show all the details in order to get some resolution. I have the following senario: - a service which hosts objects for remoting...
8
by: Raju Joseph | last post by:
Hi All, I am just trying to get an opinion here. I know this is always a tough choice to make. We are in the process of converting our VB6 based Healthcare Information System (a full-fledged...
13
by: ThunderMusic | last post by:
Hi, I have to develop an application that will consist of a service and a windows forms application... the service could be on a distant server but I need to authenticate the user as being part...
8
by: schaf | last post by:
Hi Ng! My application (version 1 a1) communicates with a service (version 1 s1). Now I would like to update the service and create a service version 2 (s2). The new function calls within s2 are...
5
by: =?Utf-8?B?QkY=?= | last post by:
I want to improve the response time of my application. I have 3 options: 1. Run both ASPX pages and our business objects on web server and use web farm technology. 2. Move our business objects...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.