aboutsummaryrefslogtreecommitdiff
path: root/Tools/Hazel-Networking/Hazel/NewConnectionEventArgs.cs
blob: c3fd62fa09218fa6747c2a2ac66836fc440b6f0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
namespace Hazel
{
    public struct NewConnectionEventArgs
    {
        /// <summary>
        /// The data received from the client in the handshake.
        /// You must not recycle this. If you need the message outside of a callback, you should copy it.
        /// </summary>
        public readonly MessageReader HandshakeData;

        /// <summary>
        /// The <see cref="Connection"/> to the new client.
        /// </summary>
        public readonly Connection Connection;

        public NewConnectionEventArgs(MessageReader handshakeData, Connection connection)
        {
            this.HandshakeData = handshakeData;
            this.Connection = connection;
        }
    }
}