Sunny
7/22/2004 9:42:00 PM
Hi Chester,
inline:
In article <e39kPlCcEHA.3012@tk2msftngp13.phx.gbl>, cwest@video-
mation.com says...
> Sunny -
>
> Again, thanks for the assistance....I REALLY appreciate you taking a
> "newbie" under your wing...
>
> All of this makes sense. However, in regards to the client and server, in
> the application I am working on there is only one application, which can be
> either a client or a server depending on the situation. What is common is
> that
> it is (at this point) pier-to-pier. Later there will be more then one
> server...but there will always be ONE master server while the other machines
> will be considered as clients.
If the application is only one and the same, there is no need of wrapper
indeed. Actually I do not know what deployment you will have, but if you
are going to release copies which will not be under your control, you
have to take in mind the possible complications with the upgrades.
Lets say you have version 1 of your app distributed. Now comes version
2, in which you have added a new functionality, some additional methods,
or you have corrected a bug. When you recompile the new version, the old
apps will not be able to communicate with the new one, because you have
changed the assembly in which your remoting class resided. Thats why I
always recommend the interface approach. Even if you change your
remoting class, it will still implement the shared interface, so the old
versions will still be able to connect.
Of course, it is not obligatory, I just make a point.
>
> That being said, I'm wondering if it makes sense to create a wrapper for
> the events since both the client and the server (in theory) know about the
> events and because of the additional complexity involved.
As I said, no need. I would only correct the wording here. The problem
is when the server does not know about the receiving object in the
client, to which the event is hooked. But as far as it is the same app,
the server will know about the client classes :)
>
> As I indicated, when I'm trying to hook up after creating a wrapper to hold
> the reference, I'm getting the exception. I can't see that I've done
> anything wrong...the only difference (and perhaps, in error) I see is that I
> am using the TcpClientChannel for connecting up on the Client-side form
> while on the Server side form I'm using TcpChannel.
In my prev post I told you that most probably the problem is that you
use TcpClientChannel. This channel does not open a listening port to
accept the server callbacks. TcpClient should solve this.
>
> My plan at this point is to try the following:
> (1) Try changing the TcpClientChannel on the client-side form to
> TcpChannel..re-try, and if it fails proceed to step 2
yes :)
> (2) Try changing the TcpChannel on the server side form to TcpServerChannel,
> leaving the TcpClientChannel alone...re-try and if it fails go to step 3
no need. TcpChannel opens Client and Server channels
> (3) Try change the TcpClientChannel to TcpChannel to match up with the
> server-form...re-try it and if if fails go to step 4
like 2.
> (4) Re-implement the class, starting with your example....if it works build
> incrementally until I have what I need...if not, go to step 5
Here you can prepare a more generic event wrapper, so you can use it for
different events.
> (5) Look at using the TcpListener class to implement things...if I decide it
> is not exactly what I want to use go to step 6
Hmmm, if it is not a pure data exchange, better stay with remoting :).
If you are going to open a new socket for every event ...
> (6) Implement messaging by creating a table in SQL server, and poll the
> table every second (not very scalable, but at least it will work...)
So, just replacing one type of server with another, more heavy :)
>
> If you've got further idea's I'm listening....I'll look at the article
> you've sent (you send very informative ones!)
whithout knowing the final goal ... no way :)
Cheers
Sunny