C# Class Libmpc.MpcConnection

Keeps the connection to the MPD server and handels the most basic structure of the MPD protocol. The high level commands are handeled in the Libmpc.Mpc class.
显示文件 Open project: sakya/wpfmpdclient Class Usage Examples

Public Methods

Method Description
Connect ( ) : void

Connects to the MPD server who's IPEndPoint was set in the Server property.

Connect ( IPEndPoint server ) : void

Connects to a MPD server.

Disconnect ( ) : void

Disconnects from the current MPD server.

Exec ( string command ) : MpdResponse

Executes a simple command without arguments on the MPD server and returns the response.

Exec ( string command, string argument ) : MpdResponse

Executes a MPD command with arguments on the MPD server.

Idle ( Mpc subsystems ) : void

Puts the client in idle mode for the given subsystems

MpcConnection ( ) : System

Creates a new MpdConnection.

MpcConnection ( IPEndPoint server ) : System

Creates a new MpdConnection.

Private Methods

Method Description
CheckConnected ( ) : void
ClearConnectionFields ( ) : void
WriteToken ( string token ) : void
readResponse ( ) : MpdResponse

Method Details

Connect() public method

Connects to the MPD server who's IPEndPoint was set in the Server property.
If no IPEndPoint was set to the Server property.
public Connect ( ) : void
return void

Connect() public method

Connects to a MPD server.
public Connect ( IPEndPoint server ) : void
server System.Net.IPEndPoint The IPEndPoint of the server.
return void

Disconnect() public method

Disconnects from the current MPD server.
public Disconnect ( ) : void
return void

Exec() public method

Executes a simple command without arguments on the MPD server and returns the response.
If the command contains a space of a newline charakter.
public Exec ( string command ) : MpdResponse
command string The command to execute.
return MpdResponse

Exec() public method

Executes a MPD command with arguments on the MPD server.
If the command contains a space of a newline charakter.
public Exec ( string command, string argument ) : MpdResponse
command string The command to execute.
argument string The arguments of the command.
return MpdResponse

Idle() public method

Puts the client in idle mode for the given subsystems
public Idle ( Mpc subsystems ) : void
subsystems Mpc The subsystems to listen to.
return void

MpcConnection() public method

Creates a new MpdConnection.
public MpcConnection ( ) : System
return System

MpcConnection() public method

Creates a new MpdConnection.
public MpcConnection ( IPEndPoint server ) : System
server System.Net.IPEndPoint The IPEndPoint of the MPD server.
return System