C# Class Yaircc.Net.IRC.Connection

Represents a connection to an IRC server.
Inheritance: IDisposable
显示文件 Open project: rastating/yaircc Class Usage Examples

Public Methods

Method Description
Close ( ) : void

Closes the socket used to interact with the server.

Connect ( ) : void

Begin establishing the connection asynchronously.

Connection ( ) : System

Initialises a new instance of the Yaircc.Net.IRC.Connection class.

Connection ( string server ) : System

Initialises a new instance of the Yaircc.Net.IRC.Connection class.

Connection ( string server, int port ) : System

Initialises a new instance of the Yaircc.Net.IRC.Connection class.

Connection ( string server, int port, string password ) : System

Initialises a new instance of the Yaircc.Net.IRC.Connection class.

Dispose ( ) : void

Disposes the object.

Equals ( object obj ) : bool

Determines whether the specified object is equal to the current object.

GetHashCode ( ) : int

Serves as a hash function for a particular type.

Parse ( string command ) : ParseResult

Parses command and returns a ParseResult object to indicate the result of the operation

RegisterClient ( ) : void

Sends the registration commands needed when initialising an IRC connection.

RegisterClient ( string password, string username, string nickname, string realName ) : void

Sends the registration commands needed when initialising an IRC connection.

Send ( string data ) : void

Send a string of data to the server

ToString ( ) : string

Returns a string that represents the current object.

Private Methods

Method Description
ConnectCallback ( IAsyncResult result ) : void

Handles the connection request callback of the under lying socket.

ReceiveCallback ( IAsyncResult result ) : void

Handles the incoming data callback of the under lying socket.

ReplyToPing ( string rawData ) : void

Send a reply to a ping command.

Send ( byte data ) : void

Send a string of data to the server

SendCallback ( IAsyncResult result ) : void

Handles the outgoing data callback of the under lying socket.

Timer_Elapsed ( object sender, System e ) : void

Handles the Elapsed event of System.Timers.Timer.

Method Details

Close() public method

Closes the socket used to interact with the server.
public Close ( ) : void
return void

Connect() public method

Begin establishing the connection asynchronously.
public Connect ( ) : void
return void

Connection() public method

Initialises a new instance of the Yaircc.Net.IRC.Connection class.
public Connection ( ) : System
return System

Connection() public method

Initialises a new instance of the Yaircc.Net.IRC.Connection class.
public Connection ( string server ) : System
server string The server that will be connected to.
return System

Connection() public method

Initialises a new instance of the Yaircc.Net.IRC.Connection class.
public Connection ( string server, int port ) : System
server string The server that will be connected to.
port int The port number on which to connect to.
return System

Connection() public method

Initialises a new instance of the Yaircc.Net.IRC.Connection class.
public Connection ( string server, int port, string password ) : System
server string The server that will be connected to.
port int The port number on which to connect to.
password string The password of the server.
return System

Dispose() public method

Disposes the object.
public Dispose ( ) : void
return void

Equals() public method

Determines whether the specified object is equal to the current object.
public Equals ( object obj ) : bool
obj object The object to compare with the current object.
return bool

GetHashCode() public method

Serves as a hash function for a particular type.
public GetHashCode ( ) : int
return int

Parse() public method

Parses command and returns a ParseResult object to indicate the result of the operation
public Parse ( string command ) : ParseResult
command string The command issued by the user to parse
return ParseResult

RegisterClient() public method

Sends the registration commands needed when initialising an IRC connection.
public RegisterClient ( ) : void
return void

RegisterClient() public method

Sends the registration commands needed when initialising an IRC connection.
public RegisterClient ( string password, string username, string nickname, string realName ) : void
password string The password of the server.
username string The user name to connect with.
nickname string The nick name to connect with.
realName string The real name to connect with.
return void

Send() public method

Send a string of data to the server
public Send ( string data ) : void
data string The data to send
return void

ToString() public method

Returns a string that represents the current object.
public ToString ( ) : string
return string