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

Disable the debugger on Android until mio works on Android #14270

Merged
merged 1 commit into from Nov 19, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Disable the debugger on Android until mio works on Android

  • Loading branch information
larsbergstrom committed Nov 18, 2016
commit ca0078a6e1257288f387462029849b40dfa00d99
@@ -13,4 +13,6 @@ crate_type = ["rlib"]
[dependencies]
log = "0.3.5"
util = {path = "../util"}

[target.'cfg(not(target_os = "android"))'.dependencies]
ws = "0.5.3"
@@ -5,11 +5,13 @@
#[macro_use]
extern crate log;
extern crate util;
#[cfg(not(target_os = "android"))]
extern crate ws;

use std::sync::mpsc;
use std::sync::mpsc::channel;
use util::thread::spawn_named;
#[cfg(not(target_os = "android"))]
use ws::{Builder, CloseCode, Handler, Handshake};

enum Message {
@@ -18,10 +20,12 @@ enum Message {

pub struct Sender(mpsc::Sender<Message>);

#[cfg(not(target_os = "android"))]
struct Connection {
sender: ws::Sender
}

#[cfg(not(target_os = "android"))]
impl Handler for Connection {
fn on_open(&mut self, _: Handshake) -> ws::Result<()> {
debug!("Connection opened.");
@@ -37,6 +41,7 @@ impl Handler for Connection {
}
}

#[cfg(not(target_os = "android"))]
pub fn start_server(port: u16) -> Sender {
debug!("Starting server.");
let (sender, receiver) = channel();
@@ -60,10 +65,21 @@ pub fn start_server(port: u16) -> Sender {
Sender(sender)
}

#[cfg(target_os = "android")]
pub fn start_server(_: u16) -> Sender {
panic!("Debugger is not supported on Android");
}

#[cfg(not(target_os = "android"))]
pub fn shutdown_server(sender: &Sender) {
debug!("Shutting down server.");
let &Sender(ref sender) = sender;
if let Err(_) = sender.send(Message::ShutdownServer) {
warn!("Failed to shut down server.");
}
}

#[cfg(target_os = "android")]
pub fn shutdown_server(_: &Sender) {
panic!("Debugger is not supported on Android");
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.