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

Add Socket for standalone server #4154

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

trickymagus
Copy link

Currently, the scrcpy-server uses LocalSocket for communication.
However, when attempting to run the scrcpy-server as a standalone server and connect to the LocalSocket through another android application, a permission error occurs.
We can add the capability to use Socket instead of LocalSocket, allowing other applications to communicate with the scrcpy-server.

This allows using Socket instead of LocalSocket when tunnel_forward is true.
@rom1v
Copy link
Collaborator

rom1v commented Jul 11, 2023

Hi,

Although scrcpy-server exposes some options to simplify using it as a standalone server (because "why not"), their implementation is trivial and non invasive.

Its primary purpose is still to serve the scrcpy client. I don't want to expose unrelated features just for external usages of scrcpy-server as a standalone server (it brings more complexity, more code to maintain, untested code…).


Socket videoExtSocket = null;
Socket audioExtSocket = null;
Socket controlExtSocket = null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is not a good design, which adds unnecessary complexity and redundant branching judgments to the program. In order to implement Socket support, I'd be inclined to implement a Socket wrapper to provide a unified interface, and subsequently implement Socket and LocalSocket separately within it. however, your code contribution here is definitely a good enough PoC.

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

Successfully merging this pull request may close these issues.

None yet

3 participants