9 Replies - 2154 Views - Last Post: 28 December 2010 - 02:04 PM Rate Topic: -----

#1 DinaHamdy   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 18-December 10

how to make my online contacts see me when i log in (WCF C# Chat appli

Posted 28 December 2010 - 12:14 PM

well i'm making a chat application using WCF C# .. and i've the problem of making people see online contacts when they sign in

i have 2 service functions that return lists of online and offline contacts when the user sign in

but when someone from the offline contacts sign in while i'm online ,, that contact doesn't change from being offline to online

Can anyone help me with that ???
Is This A Good Question/Topic? 1
  • +

Replies To: how to make my online contacts see me when i log in (WCF C# Chat appli

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15882
  • View blog
  • Posts: 63,565
  • Joined: 12-June 08

Re: how to make my online contacts see me when i log in (WCF C# Chat appli

Posted 28 December 2010 - 12:16 PM

The quick way would be when the user signs off it sends a 'sign off' event out to everyone in its list...
Was This Post Helpful? 1
  • +
  • -

#3 DinaHamdy   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 18-December 10

Re: how to make my online contacts see me when i log in (WCF C# Chat appli

Posted 28 December 2010 - 12:17 PM

View Postmodi123_1, on 28 December 2010 - 11:16 AM, said:

The quick way would be when the user signs off it sends a 'sign off' event out to everyone in its list...


could you explain more please ? :$
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15882
  • View blog
  • Posts: 63,565
  • Joined: 12-June 08

Re: how to make my online contacts see me when i log in (WCF C# Chat appli

Posted 28 December 2010 - 12:29 PM

Chat application A has a list of friends.
When A is hitting the 'closing' event have it send a service call to everyone in the list of friends with a simple 'I am leaving' event.
The list of friends all pickup this one time event and move A from the active to not active list.
Was This Post Helpful? 1
  • +
  • -

#5 DinaHamdy   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 18-December 10

Re: how to make my online contacts see me when i log in (WCF C# Chat appli

Posted 28 December 2010 - 01:00 PM

View Postmodi123_1, on 28 December 2010 - 11:29 AM, said:

Chat application A has a list of friends.
When A is hitting the 'closing' event have it send a service call to everyone in the list of friends with a simple 'I am leaving' event.
The list of friends all pickup this one time event and move A from the active to not active list.


well actually it seems i can't understand what you mean :$ in WCF each user who logs on has his own form of online and offline contact lists so for example, if you are online and i'm offline, you do have me in your offline list right now, but when i sign in ,i should be moved to your online contact list in your already opened form ! so how am i supposed to change your contact list while my form is opening now and your form is like dead to me because it's already opened before me .. i hope u got what i mean :)

i heard about something called ICHATCALLBACK that helps in this but i'm not sure about it and really dun know how to use it

I appreciate your help :)
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15882
  • View blog
  • Posts: 63,565
  • Joined: 12-June 08

Re: how to make my online contacts see me when i log in (WCF C# Chat appli

Posted 28 December 2010 - 01:15 PM

Okay - new angle of attack. If application instance A is already on... and instance B signs on, how does A know B is online?
Was This Post Helpful? 0
  • +
  • -

#7 DinaHamdy   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 18-December 10

Re: how to make my online contacts see me when i log in (WCF C# Chat appli

Posted 28 December 2010 - 01:17 PM

View Postmodi123_1, on 28 December 2010 - 12:15 PM, said:

Okay - new angle of attack. If application instance A is already on... and instance B signs on, how does A know B is online?


YESSSSSSSSSSSSSSSSS that's what i mean and what i want and what i need :D:D:D
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15882
  • View blog
  • Posts: 63,565
  • Joined: 12-June 08

Re: how to make my online contacts see me when i log in (WCF C# Chat appli

Posted 28 December 2010 - 01:25 PM

Oh. I thought you already had that. How are you determining who is online or off line when I start an instance of my chat program? You said "i have 2 service functions that return lists of online and offline contacts when the user sign in" - where is that information coming from?
Was This Post Helpful? 0
  • +
  • -

#9 DinaHamdy   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 18-December 10

Re: how to make my online contacts see me when i log in (WCF C# Chat appli

Posted 28 December 2010 - 01:34 PM

View Postmodi123_1, on 28 December 2010 - 12:25 PM, said:

Oh. I thought you already had that. How are you determining who is online or off line when I start an instance of my chat program? You said "i have 2 service functions that return lists of online and offline contacts when the user sign in" - where is that information coming from?


okay here it again ,, when instance A signs in a service function check in the database for the online and offline contacts for that instance A BUT if one from those offline contacts signs in while A is running nothing changes in the lists :D

it seems i can't get you to understand what i mean ..

let's say instance A and B are online and instance C is offline
so instance A online list is B and offline list is C
if C signs in now
instance A will still have online list B and offline list C

which i don't want As i want C to appear to be online at A and B

But when C signs in it will have it's online list As A and B

so that means that when anyone signs in for the first time i can get them the online and offline list but if someone changed his status i can't update the lists in the instances that are already running

did you get it ??????
Was This Post Helpful? 0
  • +
  • -

#10 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15882
  • View blog
  • Posts: 63,565
  • Joined: 12-June 08

Re: how to make my online contacts see me when i log in (WCF C# Chat appli

Posted 28 December 2010 - 02:04 PM

You never mentioned a database before, and that makes somewhat sense.

What you will need to do is change your application in one of two ways. One way is to poll the database every few seconds to see if anyone signed on or off. Keep getting that list. That is not a really good solution, but it works for the short term.

The better option is each instance of the application's list of friends is a unique name for them. Each instance listens to a specific port for incoming messages. When you sign on to application A it uses that specific port (and it's name) and broadcasts a message out to each person in A's friend list saying "I am on!". When instance B and C receive that message they move A from the 'inactive' to 'active' list in response to that event. Everything works the same in reverse.

The better option will require you to rewrite quite a bit and learn how to send events with WPF that are picked up by other objects. Tough but totally do-able.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1