QNetworkReader

This commit is contained in:
JohnCorby 2021-12-02 19:19:07 -08:00
parent 8f148c5666
commit a32e510c55
2 changed files with 5 additions and 5 deletions

View File

@ -16,14 +16,14 @@ namespace QuantumUNET
public QNetworkClient() public QNetworkClient()
{ {
m_MsgBuffer = new byte[65535]; m_MsgBuffer = new byte[65535];
m_MsgReader = new NetworkReader(m_MsgBuffer); m_MsgReader = new QNetworkReader(m_MsgBuffer);
AddClient(this); AddClient(this);
} }
public QNetworkClient(QNetworkConnection conn) public QNetworkClient(QNetworkConnection conn)
{ {
m_MsgBuffer = new byte[65535]; m_MsgBuffer = new byte[65535];
m_MsgReader = new NetworkReader(m_MsgBuffer); m_MsgReader = new QNetworkReader(m_MsgBuffer);
AddClient(this); AddClient(this);
SetActive(true); SetActive(true);
m_Connection = conn; m_Connection = conn;
@ -60,7 +60,7 @@ namespace QuantumUNET
private readonly QNetworkMessageHandlers m_MessageHandlers = new(); private readonly QNetworkMessageHandlers m_MessageHandlers = new();
protected QNetworkConnection m_Connection; protected QNetworkConnection m_Connection;
private readonly byte[] m_MsgBuffer; private readonly byte[] m_MsgBuffer;
private readonly NetworkReader m_MsgReader; private readonly QNetworkReader m_MsgReader;
protected ConnectState m_AsyncConnect = ConnectState.None; protected ConnectState m_AsyncConnect = ConnectState.None;
private string m_RequestedServerHost = ""; private string m_RequestedServerHost = "";

View File

@ -18,7 +18,7 @@ namespace QuantumUNET
public ReadOnlyCollection<QNetworkConnection> connections { get; } public ReadOnlyCollection<QNetworkConnection> connections { get; }
public Dictionary<short, QNetworkMessageDelegate> handlers => m_MessageHandlers.GetHandlers(); public Dictionary<short, QNetworkMessageDelegate> handlers => m_MessageHandlers.GetHandlers();
public byte[] messageBuffer { get; private set; } public byte[] messageBuffer { get; private set; }
public NetworkReader messageReader { get; private set; } public QNetworkReader messageReader { get; private set; }
public Type networkConnectionClass { get; private set; } = typeof(QNetworkConnection); public Type networkConnectionClass { get; private set; } = typeof(QNetworkConnection);
public void SetNetworkConnectionClass<T>() public void SetNetworkConnectionClass<T>()
@ -32,7 +32,7 @@ namespace QuantumUNET
m_Initialized = true; m_Initialized = true;
NetworkTransport.Init(); NetworkTransport.Init();
messageBuffer = new byte[65535]; messageBuffer = new byte[65535];
messageReader = new NetworkReader(messageBuffer); messageReader = new QNetworkReader(messageBuffer);
if (hostTopology == null) if (hostTopology == null)
{ {
var connectionConfig = new ConnectionConfig(); var connectionConfig = new ConnectionConfig();