Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active mode support #16

Open
rsichnyi opened this issue Sep 22, 2015 · 5 comments
Open

Active mode support #16

rsichnyi opened this issue Sep 22, 2015 · 5 comments

Comments

@rsichnyi
Copy link
Contributor

@pohmelie please take a look at https://github.com/pohmelie/aioftp/compare/master...Alliera:active-mode?expand=1 - i know it's dirty and needs tests so didn't create a PR yet. Also maybe you have better ideas about implementation?

@pohmelie
Copy link
Collaborator

At first look I think it is better to pass "passive" argument directly to download/upload/stream methods, not as init parameter, so we can change it from request to request. And there should be three functions: get_data_connection, get_passive_connection and get_active_connection. It will be more clean and get_data_connection will not be a monster 😄. Also get_active_connection (so do client) should handle one server and one data connection all the time (closing incomming if already connected), like server do. Server decorators should be modified of course.
The idea is right, I think. But it's big deal.

@rsichnyi
Copy link
Contributor Author

At first look I think it is better to pass "passive" argument directly to download/upload/stream methods, not as init parameter, so we can change it from request to request

I'm not really sure that there're use cases when you need to use both modes in the same session. If you really do you can just change client to passive/active mode before the next command call.

Regarding closing server and connections in client - i know, as i said it's still quick/dirty and it's just a miracle that it works and passes current tests ;)

@pohmelie
Copy link
Collaborator

I'm not really sure that there're use cases when you need to use both modes in the same session. If you really do you can just change client to passive/active mode before the next command call.

I will think about it. Maybe there is third solution.

@pohmelie
Copy link
Collaborator

"passiveserver" in __init__ should be replaced by something like "data_connection_mode", which value is one of Enum: ConnectionMode.PASSIVE, ConnectionMode.ACTIVE (don't remember style for constants… is it caps?)

@pohmelie
Copy link
Collaborator

@rsichny look at #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants