public void StartRemoteListener()
{
int port = (int) _prefs["RemoteControl"]["BansheeRemote"]["remote_control_port"].BoxedValue;
try {
_listener.Disconnect(false);
} catch {
}
try {
Log.Information("remote listener start listening on port " + port.ToString());
IPEndPoint endpoint = new IPEndPoint(IPAddress.Any, port);
_listener = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
_listener.Bind(endpoint);
_listener.Listen(10);
_listener.BeginAccept(OnIncomingConnection, _listener);
} catch (Exception e) {
if (!_disposed) {
Log.Error("error while starting remote listener", e.Message);
}
}
}