aMSN Forums
May 18, 2013, 01:51:38 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to support multiple P2P sessions  (Read 5338 times)
BenoitRen
Newbie

Offline Offline

Posts: 8


View Profile
« on: June 16, 2009, 05:57:12 pm »

I'm curious as to how one would support multiple P2P sessions in the same switchboard session. I know the official client seems to support it, for example receiving two files at the same time.

But the obvious question is, how would one determine which session incoming messages are for? Data messages don't carry the Call-ID field. They do, however, carry the BaseIdentifier field in the binary header. But that field could just as well be wrong...

Just throwing some thoughts out there.
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #1 on: June 16, 2009, 11:37:43 pm »

it's the first 4 bytes : the session id... that's what you use to identify.. a session...
Logged

KaKaRoTo
BenoitRen
Newbie

Offline Offline

Posts: 8


View Profile
« Reply #2 on: June 17, 2009, 04:02:13 pm »

But those 4 bytes are NUL as long as the session is being negotiated. I was also under the impression that the SessionID field used in the MSNSLP message during negotiation had to be the same as the ID for the switchboard session (though aMSN always had another number when I looked at the logs). Is this incorrect?
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #3 on: June 17, 2009, 07:01:21 pm »

if it's NULL, then you have SLP data in the message and you either have sessionid or callid to figure out the session. For acks, you can use the ack-id to know which packet was acked, independent of the session.
the sessionid is unique to the p2p session, and it has absolutely nothing to do with the switchboard... and afaik the switchboard doesn't have anything called a session!!!!!
Why don't you go read the docs ( http://msnpiki.msnfanatic.com/index.php/MSNC:Binary_Headers ) and try to figure it out by youself before asking questions with obvious answers, you are just wasting my time over this.
Logged

KaKaRoTo
BenoitRen
Newbie

Offline Offline

Posts: 8


View Profile
« Reply #4 on: June 18, 2009, 07:18:06 pm »

Hey, hey, easy now. I have read the documentation many times, but it doesn't tell you where the session ID field in the messages actually comes from. Like, if you have to generate it or get it from somewhere. If it was clear instead of left ambiguous, I wouldn't be asking these questions!

The switchboard does have sessions, and it even has a session ID. It is given as a parameter of the CAL command when you invite someone to your session, and as a parameter of the RNG command when you're being invited to a session.
Logged
kjir
Power user
*
Offline Offline

Posts: 133


View Profile
« Reply #5 on: June 18, 2009, 08:06:29 pm »

Actually here it says where the Session ID comes from:
http://msnpiki.msnfanatic.com/index.php/MSNC:MSNSLP#Starting_a_session
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #6 on: June 18, 2009, 09:23:56 pm »

You are asking questions here that aren't related to aMSN, we are nice enough to try and help, but you should do your own homework and try to figure things out yourself before wasting the time of others for things you could do yourself! If you've read it many times, then you didn't read it hard enough or you just don't have the skills to figure it out, then forget about it! When you ask questions and I tell give you the answer and tell you you're wasting my time with stupid questions, you should say "oh sorry, i'll try reading the docs again", not start arguing and telling me to take it 'easy'...  That's just being rude, and I don't answer to rude people!
And no, the switchboard doesn't have any session, that number is the CKI authentication token, nothing more. If it was a session id, then it would be the same on both sides, but when you invite two users for example, they each get a completely different authentication token.
You say you've read the docs many times, well I doubt it, considering it's all explained here : http://msnpiki.msnfanatic.com/index.php/MSNP8:SBAuthentication
Quote
The third parameter specifies the type of authentication, which should always be CKI.
The fourth parameter is an authentication string that the client will need to send when connecting to the switchboard to prove its identity.
Logged

KaKaRoTo
BenoitRen
Newbie

Offline Offline

Posts: 8


View Profile
« Reply #7 on: June 19, 2009, 12:52:00 am »

Quote from: "kjir"
Actually here it says where the Session ID comes from:
http://msnpiki.msnfanatic.com/index.php/MSNC:MSNSLP#Starting_a_session

Thanks. It's not completely unambiguous, but I guess it does suggest that it's a generated one.
Quote from: "kakaroto"
You are asking questions here that aren't related to aMSN

I thought talking about the protocol was okay in this forum, since it's indirectly related to aMSN development, being an MSN client.I wasn't informed that it wasn't okay. The board rules don't prohibit it either.
Quote
you should do your own homework and try to figure things out yourself before wasting the time of others for things you could do yourself

You're assuming I didn't try to figure things out and just barged in here asking questions. This is not the case. $DEITY forbid I get confused about something or make an error!
Quote
When you ask questions and I tell give you the answer and tell you you're wasting my time with stupid questions, you should say "oh sorry, i'll try reading the docs again", not start arguing and telling me to take it 'easy'... That's just being rude, and I don't answer to rude people!

You were being rude with your attitude, which is why I told you to take it easy. I argued because I did read the documentation and didn't see an unambigous note about it.
Quote
You say you've read the docs many times, well I doubt it, considering it's all explained here : http://msnpiki.msnfanatic.com/index.php/MSNP8:SBAuthentication

Did you read that page yourself? It says "Requesting a Switchboard Session" and "Getting Invited to a Switchboard Session". Also, for RNG, it says:
Quote from: "MSNP documentation"
The first parameter is the session ID of the new switchboard session. Every switchboard session has a unique ID, and each principal invited will use the same session ID. You will need this for authenticating with the switchboard.

Finally, on MSNP8:SBMiscellaneous, for CAL it says:
Quote from: "MSNP documentation"
If successful, the server will respond with another CAL with the same TrID, the string RINGING as the first parameter, and the session ID of this switchboard session as the second parameter.

If I'm really wasting your time, there are nicer ways to say so.
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #8 on: June 19, 2009, 03:24:06 am »

Alright, it seems like I was in a bad mood, I'm sorry for being so rude to you, I just felt like you were asking questions without taking the time to look for answers for yourself, thus wasting my time over yours...
Talking about the protocol here is ok, I like to help other developers with the knowledge I gained, so it's perfectly fine, but we have no obligation, and if we answer you, it's because we're nice and we want to help, so showing some appreciation is nice, being rude is bad...
about the SB sessionid, it looks like you're right!!!  although I pretty much know 99% of the protocol, all in my head, I actually never realized that an SB has a sessionid, sorry for the confusion.
Logged

KaKaRoTo
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!