473,698 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
7 1785
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********@opt ushome.com.au> wrote in message
news: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 #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.publi c.dotnet.langua ges.csharp/<41************ ***********@new s.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@NoSpamPlea se_Digita.com> wrote in message
news:ek******** *****@tk2msftng p13.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********@opt ushome.com.au> wrote in message
news: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 #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********@opt ushome.com.au> wrote in message
news:41******** *************** @news.optusnet. com.au...
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@NoSpamPlea se_Digita.com> wrote in message
news:ek******** *****@tk2msftng p13.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********@opt ushome.com.au> wrote in message
news: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 #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******@devel op.com> wrote in message
news:uJ******** *****@TK2MSFTNG P14.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.publi c.dotnet.langua ges.csharp/<41************ ***********@new s.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@NoSpamPlea se_Digita.com> wrote in message
news:u$******** ******@TK2MSFTN GP09.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********@opt ushome.com.au> wrote in message
news:41******** *************** @news.optusnet. com.au...
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@NoSpamPlea se_Digita.com> wrote in message
news:ek******** *****@tk2msftng p13.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********@opt ushome.com.au> wrote in message
news: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 #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********@opt ushome.com.au> wrote in message
news:41******** *************** @news.optusnet. com.au...
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@NoSpamPlea se_Digita.com> wrote in message
news:u$******** ******@TK2MSFTN GP09.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********@opt ushome.com.au> wrote in message
news:41******** *************** @news.optusnet. com.au...
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@NoSpamPlea se_Digita.com> wrote in message
news:ek******** *****@tk2msftng p13.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********@opt ushome.com.au> wrote in message
> news: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 #8

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

Similar topics

3
4692
by: Deepal | last post by:
Hi; I'm doing an example program from a book regarding .NET Remoting. Both the Client and Server are C# Console Applications. Server Code is using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp;
4
3115
by: Uchiha Jax | last post by:
Hello everyone, I am a plenty silly person who is trying to learn .NET remoting through trial and error (all articles I read are going over my head at the moment (mostly) so I thought i'd give it a go). What I want to do is this: Have a server instance of the program, this server instance will receive communication from client programs (as demonstrated in the AddMessage()
3
2869
by: Steve | last post by:
I've been following a couple remoting tutorials on the web, they are all pretty much the same. I've got my different applications built(client, server and remote object (dll)) The client is able to get a reference to the remote object and that works fine. When I try to make a call to a remote object's method I get an exception: System.Runtime.Serialization.SerializationException: Cannot find the assembly ProcessTest,...
4
5334
by: Michael Lindsey | last post by:
I need to write a server app to send images to client GUIs that are outside of the server's domain. The client will have the file system path to the image but can not access the file system. I am trying to decide if I should use remoting vs. writing a server that uses networkstreams. I have read that networkstreams\tcp programming should be faster than remoting and is a better choice for what I am doing but that it is difficult to code.
1
2432
by: Alexandre (www.pointnetsolutions.com) | last post by:
I am looking at building a distributed system, and i have been looking at many different options, in some cases i was thinking of a client server relation where a client would send a string to the system as a command. i also looked at the GOF Command pattern which i could somewhat use with
1
2827
by: Michael Bray | last post by:
Ok guys here's a tough one... I have a client/server application that uses remoting for communication. I am using Activator.GetObject to create a remoting instance with an URL that specifies the client machine by name. The *application* server in this case is the *remoting* client. In other words, the "application server" needs to talk to the "application client" to tell it that there is a new configuration available for it, and that...
3
2316
by: Michael Maes | last post by:
Hi, We have a windows service passing objects to a client application by remoting. The windows service is started and running successfully. * When the client app is running on the same machine as the windows service (W2K3) every method gets executed successfully. * When the client app is running on a different machine (XP SP2), some methods from the remote object the client calls make client hang. Other
6
2081
by: Palvinder Singh | last post by:
Hello google group peeps, I am new to remoting, but have a grasp of it. I am trying to create a server/client application, which will be deployed over an intranet. I have upwards of five clients that connect to a main server. The client application sets the state of several switchs (on/off by means of clicking a button). When a switch is turned on/off, its state is updated on the server, which will then raise an event to update...
7
2175
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi I am trying to see if I can call a Library remotely. The library contains a Form that I want to display then pass back some data to user that called this form remotely. I have it working some-what. I am able to call form remotely and return data to client but somewhere after closing remote form and returning data - I get a Windows exception -
0
8603
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8895
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2329
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.