467,925 Members | 1,912 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,925 developers. It's quick & easy.

multichat client remoting issue - remoting

Tom
hi,

I'm trying to write a multi client chat app using remoting. however atm, I'm
stuck when a userA tries to send userB a msg... say there're userA, userB
and userC. on the server side how do I know which user is userB when I
recieve message from userB ?

what should the process be. I know I need to store a reference of the
clients somehow on the server. but how can this be done ?

thanks
Tom
Nov 16 '05 #1
  • viewed: 1605
Share:
7 Replies
If your server is running under IIS then you can make use of authentication
to find out who the user is. Otherwise you will have to either buy a third
party library or write your own. Here is an article that might help if your
not running under IIS.

http://msdn.microsoft.com/library/de...ml/remsspi.asp

Regards
Lee

"Tom" <to********@optushome.com.au> wrote in message
news:41***********************@news.optusnet.com.a u...
hi,

I'm trying to write a multi client chat app using remoting. however atm, I'm stuck when a userA tries to send userB a msg... say there're userA, userB
and userC. on the server side how do I know which user is userB when I
recieve message from userB ?

what should the process be. I know I need to store a reference of the
clients somehow on the server. but how can this be done ?

thanks
Tom

Nov 16 '05 #2
When signing in, get the client to pass an interface to themselves to the server and have the server allocated an ID for the user (a GUID maybe?) and return it to the client as the result of the sign-in - think of it like a session ID. Now get the client to submit the session id with each new message. The server stores the user name, GUID and interface for each connected user. In fact you could dispense with the GUID and just pass the user name with each new message.

The server can call the clients back on the interface to deliver the messages from others.

For the server to call the client you may have firewall issues and the client must be listening on a port. Normally just getting the client to use 0 as the parameter to the channel constructor will be enough. This listens on a free port, the valuke of which will be passed to the server in the marshalling information for the interface

Regards

Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog

nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<41***********************@news.optusnet.com.au>

hi,

I'm trying to write a multi client chat app using remoting. however atm, I'm
stuck when a userA tries to send userB a msg... say there're userA, userB
and userC. on the server side how do I know which user is userB when I
recieve message from userB ?

what should the process be. I know I need to store a reference of the
clients somehow on the server. but how can this be done ?

thanks
Tom

Nov 16 '05 #3
Tom
I am not looking for who the user is...

and third party is not the response I'm looking for. I want to write it
myself and I need direction on this..
"Lee Alexander" <lee@NoSpamPlease_Digita.com> wrote in message
news:ek*************@tk2msftngp13.phx.gbl...
If your server is running under IIS then you can make use of authentication to find out who the user is. Otherwise you will have to either buy a third
party library or write your own. Here is an article that might help if your not running under IIS.

http://msdn.microsoft.com/library/de...ml/remsspi.asp
Regards
Lee

"Tom" <to********@optushome.com.au> wrote in message
news:41***********************@news.optusnet.com.a u...
hi,

I'm trying to write a multi client chat app using remoting. however atm,

I'm
stuck when a userA tries to send userB a msg... say there're userA, userB and userC. on the server side how do I know which user is userB when I
recieve message from userB ?

what should the process be. I know I need to store a reference of the
clients somehow on the server. but how can this be done ?

thanks
Tom


Nov 16 '05 #4
When I wrote one to play around with remoting (a while ago) I had on the
server a SignOn and SignOff method that the client would call passing as one
of the parameters the URL of the client. This URL was used by the server as
a way of identifying a client and sending messages to it. I used
authentication to get the user name of the user on that client but you could
just pass the user name into the SignIn method if you want. Any subsequent
calls to the server from a client would pass this URL as a way of
identifying who was sending the message. I added some extra little bits like
discovery of the server using mutlicast messages so the user didn't have to
type in the server address.

HTH

Regards
Lee

"Tom" <to********@optushome.com.au> wrote in message
news:41***********************@news.optusnet.com.a u...
I am not looking for who the user is...

and third party is not the response I'm looking for. I want to write it
myself and I need direction on this..
"Lee Alexander" <lee@NoSpamPlease_Digita.com> wrote in message
news:ek*************@tk2msftngp13.phx.gbl...
If your server is running under IIS then you can make use of

authentication
to find out who the user is. Otherwise you will have to either buy a third
party library or write your own. Here is an article that might help if

your
not running under IIS.

http://msdn.microsoft.com/library/de...ml/remsspi.asp

Regards
Lee

"Tom" <to********@optushome.com.au> wrote in message
news:41***********************@news.optusnet.com.a u...
hi,

I'm trying to write a multi client chat app using remoting. however
atm, I'm
stuck when a userA tries to send userB a msg... say there're userA,

userB and userC. on the server side how do I know which user is userB when I
recieve message from userB ?

what should the process be. I know I need to store a reference of the
clients somehow on the server. but how can this be done ?

thanks
Tom



Nov 16 '05 #5
Tom
is there a way to use event delegate to do this ? it would seem to be much
easier than writing out a client interface class and keep track of it on the
server ?

Tom
"Richard Blewett [DevelopMentor]" <ri******@develop.com> wrote in message
news:uJ*************@TK2MSFTNGP14.phx.gbl...
When signing in, get the client to pass an interface to themselves to the server and have the server allocated an ID for the user (a GUID maybe?) and
return it to the client as the result of the sign-in - think of it like a
session ID. Now get the client to submit the session id with each new
message. The server stores the user name, GUID and interface for each
connected user. In fact you could dispense with the GUID and just pass the
user name with each new message.
The server can call the clients back on the interface to deliver the messages from others.
For the server to call the client you may have firewall issues and the client must be listening on a port. Normally just getting the client to use
0 as the parameter to the channel constructor will be enough. This listens
on a free port, the valuke of which will be passed to the server in the
marshalling information for the interface
Regards

Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog

nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<41***********************@news.optusnet.com.au>
hi,

I'm trying to write a multi client chat app using remoting. however atm, I'm stuck when a userA tries to send userB a msg... say there're userA, userB
and userC. on the server side how do I know which user is userB when I
recieve message from userB ?

what should the process be. I know I need to store a reference of the
clients somehow on the server. but how can this be done ?

thanks
Tom

Nov 16 '05 #6
Tom
I think you don't understand the question.. I want to send msg from userA to
userB its got nothing to do with authetication...

"Lee Alexander" <lee@NoSpamPlease_Digita.com> wrote in message
news:u$**************@TK2MSFTNGP09.phx.gbl...
When I wrote one to play around with remoting (a while ago) I had on the
server a SignOn and SignOff method that the client would call passing as one of the parameters the URL of the client. This URL was used by the server as a way of identifying a client and sending messages to it. I used
authentication to get the user name of the user on that client but you could just pass the user name into the SignIn method if you want. Any subsequent
calls to the server from a client would pass this URL as a way of
identifying who was sending the message. I added some extra little bits like discovery of the server using mutlicast messages so the user didn't have to type in the server address.

HTH

Regards
Lee

"Tom" <to********@optushome.com.au> wrote in message
news:41***********************@news.optusnet.com.a u...
I am not looking for who the user is...

and third party is not the response I'm looking for. I want to write it
myself and I need direction on this..
"Lee Alexander" <lee@NoSpamPlease_Digita.com> wrote in message
news:ek*************@tk2msftngp13.phx.gbl...
If your server is running under IIS then you can make use of

authentication
to find out who the user is. Otherwise you will have to either buy a third party library or write your own. Here is an article that might help if

your
not running under IIS.

http://msdn.microsoft.com/library/de...ml/remsspi.asp

Regards
Lee

"Tom" <to********@optushome.com.au> wrote in message
news:41***********************@news.optusnet.com.a u...
> hi,
>
> I'm trying to write a multi client chat app using remoting. however atm, I'm
> stuck when a userA tries to send userB a msg... say there're userA,

userB
> and userC. on the server side how do I know which user is userB when I > recieve message from userB ?
>
> what should the process be. I know I need to store a reference of the > clients somehow on the server. but how can this be done ?
>
> thanks
> Tom
>
>



Nov 16 '05 #7
Hi Tom,

Users A, B, and C have to be listening to a port to get a message over that
port. Either that, or the message lives in storage on another machine until
the User A goes to pick it up, which is not what I expect you are looking
for.

So User A has to make a port available.

If you want User B to be able to start a conversation with User A, then User
A has to pass some information to a common point where User B knows to go
look for it.
That information has to contain enough information to contact User A. This
usually means: the IP address of User A, the port to use, and the protocol
to use. Since the IP Address of User A may change fairly often, this data
has to be fresh.

You also have the problem of proxy servers. If User A and User B have a
proxy server between then, then the proxy server actually "owns" the IP
address of one of the players, and has to be counted on to relay the message
(something I wouldn't count on, if I were you).

Will you be using an established protocol or are you writing your own?

If you use an established protocol, you can take advantage of the support
for that protocol built in to some firewalls and proxy servers. However,
your app will conflict with other apps using the same protocol, especially
if that protocol is tied to a specific port. If you want to avoid
conflicts, best to use an established protocol over a different port, but
you lose the support from the firewalls. It's a tradeoff.

If you are willing to go with simple SOAP messages, which is what you imply
with your original post on using remoting, you get some advantages and some
disadvantages. I don't know if it will work on XP Home edition or Windows
95/98 (no web server)... that's the disadvantage. On the other hand,
there's a great deal of support in .NET for this kind of thing.

A good book to help you to understand the ins and outs of .Net Remoting is
"Advanced .NET Remoting" by Ingo Rammer. I strongly suggest that picking up
a copy of this book will give you the groundwork that you need to use .NET
Remoting for solving this problem. Certainly, .NET remoting isn't the only
way to solve this problem. If you decide to go with direct network
programming, then I don't have a good book recommendation off the top of my
head (others may), and I would suggest that you google on ".net network
programming" to find useful articles.

Good luck,
--- Nick

"Tom" <to********@optushome.com.au> wrote in message
news:41***********************@news.optusnet.com.a u...
I think you don't understand the question.. I want to send msg from userA to userB its got nothing to do with authetication...

"Lee Alexander" <lee@NoSpamPlease_Digita.com> wrote in message
news:u$**************@TK2MSFTNGP09.phx.gbl...
When I wrote one to play around with remoting (a while ago) I had on the
server a SignOn and SignOff method that the client would call passing as one
of the parameters the URL of the client. This URL was used by the server

as
a way of identifying a client and sending messages to it. I used
authentication to get the user name of the user on that client but you

could
just pass the user name into the SignIn method if you want. Any subsequent
calls to the server from a client would pass this URL as a way of
identifying who was sending the message. I added some extra little bits

like
discovery of the server using mutlicast messages so the user didn't have

to
type in the server address.

HTH

Regards
Lee

"Tom" <to********@optushome.com.au> wrote in message
news:41***********************@news.optusnet.com.a u...
I am not looking for who the user is...

and third party is not the response I'm looking for. I want to write it myself and I need direction on this..
"Lee Alexander" <lee@NoSpamPlease_Digita.com> wrote in message
news:ek*************@tk2msftngp13.phx.gbl...
> If your server is running under IIS then you can make use of
authentication
> to find out who the user is. Otherwise you will have to either buy a

third
> party library or write your own. Here is an article that might help if your
> not running under IIS.
>
>

http://msdn.microsoft.com/library/de...ml/remsspi.asp
>
> Regards
> Lee
>
> "Tom" <to********@optushome.com.au> wrote in message
> news:41***********************@news.optusnet.com.a u...
> > hi,
> >
> > I'm trying to write a multi client chat app using remoting. however
atm,
> I'm
> > stuck when a userA tries to send userB a msg... say there're
userA, userB
> > and userC. on the server side how do I know which user is userB

when I > > recieve message from userB ?
> >
> > what should the process be. I know I need to store a reference of the > > clients somehow on the server. but how can this be done ?
> >
> > thanks
> > Tom
> >
> >
>
>



Nov 16 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Steve | last post: by
4 posts views Thread by Michael Lindsey | last post: by
1 post views Thread by Alexandre (www.pointnetsolutions.com) | last post: by
1 post views Thread by Michael Bray | last post: by
6 posts views Thread by Palvinder Singh | last post: by
7 posts views Thread by =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.