Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

p2p chat (1:1 private msg)

Avatar

Level 2

Hello,

I am new in this technology. So, I want to know that how come I do a simple chat in between only two user to use p2p concept. Actually I want to make a close of http://www.chatroulette.com . So, the basic concept is any one can join here & radomly will get a peer Id & then they will comunicate on basis of that peer id. I think in lccs "ticket" means peer id. But I also dont know from where I'll get that.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Hi Nigel,

The way you explain, i guess it becomes more of a RTMP solution than a p2p solution. Because as per RTMFP, the peer id is suppose to be like the session. so does live cycle provide p2p or is it like RTMP ?

View solution in original post

12 Replies

Avatar

Former Community Member

Hi,

You can do a Peer To Peer Chat/WhiteBoard using our Player 10.1 swc. Go to our P2PDataMessagingTest Example. Any user when logs in to our service can have the option to send almost any message either through our servers or through P2P.

Once you get yourself set up with player 10.1 swc( you can read our developer guide for any 10.1 LCCS app setup), you have to turn the p2pDataMessaging property of nodeConfiguration to true for any node on which you want to send p2p data with. By default, this property is false and all nodes send data messages through our server. You can do changes to this property using our developer console Ui that shows any node and its NodeConfiguration.

As an example for chat, first get the 10.1 LCCS app set up. Then go to your developer console and enable the p2pDataMessaging property in the nodeConfigurations of history nodes under default_SimpleChat collectionNode or any other chat CollectionNode you may have mentioned. You can find these all under explore tab of developer console. After setting this property, when users come in, they will get the chat messages over p2p.

Later, you may want to build your own chat and chat UI.

Thanks

Hironmay Basu

Avatar

Level 2

hello Hironmay,

Thanks for reply. I will try as per your comments. But I want to know little more... here I show who ever was logged in they all joined in a same room but I want just 1:1 chat. Example. I have logged in 1st then at the time of login I have got a unique key which i have stored in database. Then after you and another guy have logged in. So, unique key of both of you have stored in DB. Now suppose you search for your partner so PHP backend will check who is available for chat. Suppose it get me available (randomly chosen one) then me & you will connect with each other ( I don't know how only 2 people will connect separately... so that is a question) & then our both status will be busy in DB. So if another user will search for partner backend will pick any other one to keep outside us (because our status are busy). Here if any one of us quit from chat or click to find another partner then automatically we both will "separate" & our status in DB will be available untill we get another partner randomly.

So can you tell me a procedure to start this work?

Thanks,

Rajdip Pal & Krishnendu Ghose


Avatar

Former Community Member

Hi,

Our LCCS framework is room based. So, everyone in a room will be visible on the userList unless you turn anonymous presence as true.

But we do provide options to send private message to a single user or to a group of users by specifying the recipientID/IDs on your message that can let you have a 1:1 chat.

Our basic chat itself has provision for private messaging.

Now, let's say five users are in a room and your server maintains their status of availablity. Then one user can pick anyone from the list who is available and sends him a private message. If the recipient acknowledges and agree to chat, then he can send a private message back to that sender and your server can make them both busy. I don't know how you handle status on your server.

But our framework can let you handle this statuses on client side also. You can have custom field on UserDescriptor that can show his status. I am just throwing you ideas based on what you said.

I will advise you to go over private messaging/custom fields I mentioned and you can then take better design decisions.

Hope this helps

Thanks

Hironmay Basu

Avatar

Level 2

Yes, It may help me a lot.

Let me try as you said & then if I get some problem thenI will get back to you .

Thanks a ton

Rajdip Pal

Avatar

Former Community Member

Hi Rajdip,

For this kind of app, the right approach is to have your PHP code generate

a new room for each 1:1 session - this will ensure that your users are in a

private space, and will help the client and service scale more effectively.

So, when 2 users log in, have them contact your PHP server - from there, the

PHP server can create or re-use a roomURL, which it will return to those

users' applications. Those client apps can then log into those rooms via

ConnectSessions. If you need users to switch who they're talking to, they

should again contact your PHP code and have it return a new room URL for

them to use. So your PHP code would maintain a database of rooms created and

their URLs, and be the hub by which users find (or create) other rooms.

See the server integration libraries for details on creating rooms, and

please look through the developer guide pdf - there's a section on deploying

your apps.

nigel

Avatar

Correct answer by
Former Community Member

Hi Nigel,

The way you explain, i guess it becomes more of a RTMP solution than a p2p solution. Because as per RTMFP, the peer id is suppose to be like the session. so does live cycle provide p2p or is it like RTMP ?

Avatar

Level 4

Just because I happen to be awake LCCS does provide RTMFP and we use it

in our video chat solution. We pretty much use the model Nigel laid out to

do it too.

Basically what happens is both clients connect to the LCCS service, join the

room, and then connect to each other to send audio and video data using

RTMFP. Hope that helps.

-Eric

Avatar

Level 2

Hello All,

As I am new on this technology so can you please provide me some code for RTMFP chat. Here is do not want to pass any stream through RTMP. It will be very kind if you send some code with dynamic room creation. Here I want to know I thing more .... is there any limitation to create a new room?? Because if I go for Nigel's comment then I have to create 5,000 rooms for 10,000 user (logic 2 user in 1 room).

Please suggest me

Rajdip Pal

Avatar

Former Community Member

Hi Rajdip,

There shouldn't be any issue creating many rooms - it's still more scalable

than using fewer rooms. Have a look at NodeConfiguration.p2pDataMessaging

(realizing, this does require Flash Player 10.1). For the PHP code, you'll

have to look in the serverIntegration libraries - it's pretty

straightforward.

hope that helps

nigel

Avatar

Level 2

Hello Nigel,

As because Flash Player 10.1 is on beta version that's why we do not want to use it. So, we are using flash player 10. In our project there is no concept of group chat so, 10.1 's facility of grouped chat is not required. So, please confirm me .... is it possible to make in Flash Player 10?

Thanks

Rajdip Pal

Avatar

Level 2

Hello Nigel,

I am tring to create a dynamic room. But i failed... can u suggest me how can I do this... or where can I get some example?

Thanks

Rajdip Pal

Avatar

Former Community Member

Hi Rajdip,

Some information on where you are failing might be useful - I'm assuming

you've created an accountManager object, logged in with it, and are using

the createRoom API?

nigel

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----