C# Class BF2Statistics.Gamespy.Net.GamespyTcpStream

This object is used as a Network Stream wrapper for Gamespy TCP protocol,
Inheritance: IDisposable
Afficher le fichier Open project: BF2Statistics/ControlCenter Class Usage Examples

Méthodes publiques

Свойство Type Description
Connection Socket

Protected Properties

Свойство Type Description
DisconnectEventCalled bool
RecvMessage StringBuilder
SendBytesOffset int
SendMessage List
WaitingOnAsync bool

Méthodes publiques

Méthode Description
BeginReceive ( ) : void

Begins the process of receiving a message from the client. This method must manually be called to Begin receiving data

Close ( bool DisposeEventArgs = false ) : void

Closes the underlying socket

Dispose ( ) : void
GamespyTcpStream ( GamespyTcpSocket Parent, SocketAsyncEventArgs ReadArgs, SocketAsyncEventArgs WritetArgs ) : System

Creates a new instance of GamespyTcpStream

SendAsync ( byte message ) : void

Writes a message to the client stream asynchronously

SendAsync ( string message ) : void

Writes a message to the client stream asynchronously

Private Methods

Méthode Description
HandleSocketError ( SocketError socketError ) : void

If there was a socket error, it can be handled propery here

IOComplete ( object sender, SocketAsyncEventArgs e ) : void

Event called when data has been recived from the client

ProcessReceive ( ) : void

Once data has been recived from the client, this method is called to process the data. Once a message has been completed, the OnDataReceived event will be called

ProcessSend ( ) : void

Sends a message Asynchronously to the client connection

Method Details

BeginReceive() public méthode

Begins the process of receiving a message from the client. This method must manually be called to Begin receiving data
public BeginReceive ( ) : void
Résultat void

Close() public méthode

Closes the underlying socket
public Close ( bool DisposeEventArgs = false ) : void
DisposeEventArgs bool /// If true, the EventArg objects will be disposed instead of being re-added to /// the IO pool. This should NEVER be set to true unless we are shutting down the server! ///
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

GamespyTcpStream() public méthode

Creates a new instance of GamespyTcpStream
public GamespyTcpStream ( GamespyTcpSocket Parent, SocketAsyncEventArgs ReadArgs, SocketAsyncEventArgs WritetArgs ) : System
Parent GamespyTcpSocket
ReadArgs System.Net.Sockets.SocketAsyncEventArgs
WritetArgs System.Net.Sockets.SocketAsyncEventArgs
Résultat System

SendAsync() public méthode

Writes a message to the client stream asynchronously
public SendAsync ( byte message ) : void
message byte The complete message to be sent to the client
Résultat void

SendAsync() public méthode

Writes a message to the client stream asynchronously
public SendAsync ( string message ) : void
message string The complete message to be sent to the client
Résultat void

Property Details

Connection public_oe property

Our connected socket
public Socket Connection
Résultat Socket

DisconnectEventCalled protected_oe property

Indicates whether the OnDisconnect event has been called
protected bool DisconnectEventCalled
Résultat bool

RecvMessage protected_oe property

Our message recieved from the client connection. If the message is too long, it will be sent over multiple receive operations, so we store the message parts here until we recieve the \final\ delimiter.
protected StringBuilder RecvMessage
Résultat StringBuilder

SendBytesOffset protected_oe property

The current send offset when sending asynchronously
protected int SendBytesOffset
Résultat int

SendMessage protected_oe property

Our message to send to the client. If the message is too long, it will be sent over multiple write operations, so we store the message here until its all sent
protected List SendMessage
Résultat List

WaitingOnAsync protected_oe property

Indicates whether we are currently sending a message asynchronously
protected bool WaitingOnAsync
Résultat bool