Help - Search - Members - Calendar
Full Version: Ap2Ap stream limitations
Skype Community > English > Development, Betas and Skype Garage > Skype Public API
gambit47_
Is there a limit to the number of concurrent streams that can be opened to the same user? Can one user send/receive multiple streams from another user?

I'm writing a file transfer scheme using Ap2Ap. Would I be able to write multiple files over multiple streams to the same user simultaneously? Or should I serialize them one stream at a time?
bertouta
Please visit :

http://forum.skype.com/viewtopic.php?t=56013

For the other questions, I come back to you soon.

Cheers,

Antoine
gambit47_
[quote=bertouta]Please visit :
http://forum.skype.com/viewtopic.php?t=56013[/quote]

If you look, you will see that I already participated in that discussion. It does not answer my question about the number of concurrent streams per user.
indrek_
You can open as many streams as there are Skypes running with given remote user. So say if Mike is running Skype on two of his computers with same username, you can establish two streams (one for each computer).

You can't have multiple streams with same remote Skype instance within one application. If you want multiple streams you can create multiple applications (with different names of course).

As for sending multiple files I'd recommend serializing them (or multiplexing within one stream) as it is more efficient - rather than playing with multiple applications which would create significant overhead.
gambit47_
[quote=indrek]You can open as many streams as there are Skypes running with given remote user. So say if Mike is running Skype on two of his computers with same username, you can establish two streams (one for each computer).[/quote]

How does that actually work, though? Why does Skype even allow the same username to login from multiple machines anyway? No other IM service does that.

If the source machine creates a stream to a given username, and Skype internally creates multiple streams to multiple target machines simultaneously, then how do I differentiate which machine the data is being sent to? I do not want my data copied to all machines. If one target machine closes the stream on its end, what happens to the stream on the other target machines? I am implementing a bi-directional protocol over the streams, so how do I know which machine the data is actually coming from? I guess I'll have to insert some kind of unique machine ID into all of my packets, and then have each machine ignore data that does not belong to it. That sucks.

[quote=indrek]You can't have multiple streams with same remote Skype instance within one application.[/quote]

That is good to know. I wrote my code with the assumption (since it is not in the documentation) that Skype allowed multiple streams to be created to the same username simultaneously, so now I guess I'll have to rip out all of that extra logic. What is the point of putting the username and an ID number into the stream names within an application if a username cannot have multiple streams to begin with? Wouldn't the username alone be enough?

[quote="indrek"]If you want multiple streams you can create multiple applications (with different names of course).[/quotes]

Ug. No thanks.

[quote=indrek]As for sending multiple files I'd recommend serializing them (or multiplexing within one stream) as it is more efficient[/quote]

My protocol already supporting serializing across a single stream. I don't think I will implement multiplexing at this point.
indrek_
[quote]How does that actually work, though? Why does Skype even allow the same username to login from multiple machines anyway? No other IM service does that.[/quote]

Because that's how we built it. We believe that users are bound to have multiple communication devices and we want to give them a unified account on all of those. The other IM services have decided to not take on that worthy goal. There is no rule set on how things should be, I think the other IM services have got it wrong.

[quote]If the source machine creates a stream to a given username, and Skype internally creates multiple streams to multiple target machines simultaneously, then how do I differentiate which machine the data is being sent to? I do not want my data copied to all machines. If one target machine closes the stream on its end, what happens to the stream on the other target machines? I am implementing a bi-directional protocol over the streams, so how do I know which machine the data is actually coming from? I guess I'll have to insert some kind of unique machine ID into all of my packets, and then have each machine ignore data that does not belong to it. That sucks.[/quote]

When Skype creates multiple streams with the same user - they are not dependant on each other. You are always sending your message to a specific stream and receive them from a specific stream. There is no "broadcast", closing one stream won't affect the other. As for identification - you just have to send the system identification in the initial handshake of your protocol, no need to burden every packet with it. And then remember it based on the stream identificator. As for people having multiple computers, yes that sux I guess - but it's how the world works, nothing we can really do about it. Unless you want to establish a political party, hire lots of fanatical one-computer-only people, dress them in brown shirts, take over the government (and all governments on earth) and then pass a law against it.

[quote]What is the point of putting the username and an ID number into the stream names within an application if a username cannot have multiple streams to begin with? Wouldn't the username alone be enough?[/quote]

No. As I said before, you can have multiple streams for the same user if that user runs multiple instances of Skype (at different locations). Say a home computer and work computer both running Skype at the same time (with same skype username). If they both run your client and you try to connect to given user you'll get two streams, one for each computer. Additionally when a stream is terminated, and a new one to the same user is created, it must have a different name as otherwise you wouldn't be able to tell which was dying bits of the old and which is the new one.
gambit47_
[quote=indrek]When Skype creates multiple streams with the same user - they are not dependant on each other. You are always sending your message to a specific stream and receive them from a specific stream.[/quote]

Ok, that is good enough as far as the actual data transfer is concerned. But if a user is logged into Skype at two machines, and I want my data to go to only one of them, I see no way of identifying which stream is going to which machine. There is no IP information available for contacts. No IP information about the individual streams. No unique stream ID other than a numeric value attached to the user name, but no indication of what that ID number actually represents. There has to be a way to identify 1-to-1 relationships or else the streaming system is very difficult and error-prone to use reliably for application-specific data that should not be copied all over the place.

[quote=indrek]As for identification - you just have to send the system identification in the initial handshake of your protocol[/quote]

That is not very helpful, though. Since I see no way to identify the user's location information ahead of time to match up the handshake after the stream is established, I have no way of knowing which stream is the desired stream to send the data over, and which stream(s) to disconnect immediately.

[quote=indrek]As I said before, you can have multiple streams for the same user if that user runs multiple instances of Skype (at different locations).[/quote]

What about scenerios where that is NOT desirable behavior, though? It would be nice if there was a flag available to tell Skype to establish only 1 stream to a user, regardless of how many machines the user is actually logged into. Even better if there were a way to query information about each of the user's locations and then specify which one to actually connect to. This way, a UI can be presented to the sending user asking to pick a location.

[quote=indrek]Say a home computer and work computer both running Skype at the same time (with same skype username). If they both run your client and you try to connect to given user you'll get two streams, one for each computer.[/quote]

That is exactly what I DONT want to happen. If the person is at work, for instance, then there is no point in sending the data to the home computer, especially since the user is not at home to acknowledge the data transfer. I do not want that connection to be established at all. Or at the very least, to have a way to identify the streams better so that I can disconnect the unwanted one(s).
nicolas19
Hello,

Did anybody make a reliable file transfer over application stream (a2a)?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.