C# Class Ballz.Network.Connection

Provides an abstraction of the protocol layer. Use it to establish a network connection with another game instance.
Afficher le fichier Open project: SpagAachen/Ballz Class Usage Examples

Méthodes publiques

Свойство Type Description
ClientPlayerId int
Id int

Private Properties

Свойство Type Description

Méthodes publiques

Méthode Description
Connection ( TcpClient connection, int id ) : System

Initializes a new instance of the Connection class and uses the already established connection.

Connection ( string host, int port, int id ) : System

Initializes a new instance of the Connection class and connects to the specified port on the specified host.

ReadUpdates ( ) : void
Send ( object obj ) : bool

Serializes on object and send it to another game instance.

Method Details

Connection() public méthode

Initializes a new instance of the Connection class and uses the already established connection.
public Connection ( TcpClient connection, int id ) : System
connection System.Net.Sockets.TcpClient An already established connection.
id int Id for this connection
Résultat System

Connection() public méthode

Initializes a new instance of the Connection class and connects to the specified port on the specified host.
public Connection ( string host, int port, int id ) : System
host string The DNS name of the remote host to which you intend to connect.
port int The port number of the remote host to which you intend to connect.
id int Id for this connection
Résultat System

ReadUpdates() public méthode

public ReadUpdates ( ) : void
Résultat void

Send() public méthode

Serializes on object and send it to another game instance.
public Send ( object obj ) : bool
obj object The object to send
Résultat bool

Property Details

ClientPlayerId public_oe property

public int ClientPlayerId
Résultat int

Id public_oe property

public int Id
Résultat int