Skip to content

Commit c141dcd

Browse files
committed
docs(xml): Added XML documentation to Transport and SocketTasks
1 parent 201fc7f commit c141dcd

File tree

3 files changed

+82
-3
lines changed

3 files changed

+82
-3
lines changed

MLAPI/Transports/MultiplexTransportAdapter.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
namespace MLAPI.Transports.Multiplex
66
{
7+
/// <summary>
8+
/// Multiplex transport adapter.
9+
/// </summary>
710
public class MultiplexTransportAdapter : Transport
811
{
912
/// <summary>
@@ -39,6 +42,7 @@ public enum ConnectionIdSpreadMethod
3942
Spread
4043
}
4144

45+
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
4246
public ConnectionIdSpreadMethod SpreadMethod = ConnectionIdSpreadMethod.MakeRoomLastBits;
4347
public Transport[] Transports = new Transport[0];
4448
public override ulong ServerClientId => 0;
@@ -322,5 +326,7 @@ public byte GetFirstSupportedTransportIndex()
322326

323327
return 0;
324328
}
329+
330+
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
325331
}
326332
}

MLAPI/Transports/Tasks/SocketTask.cs

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@
33

44
namespace MLAPI.Transports.Tasks
55
{
6+
/// <summary>
7+
/// Represents one or more socket tasks.
8+
/// </summary>
69
public class SocketTasks
710
{
11+
/// <summary>
12+
/// Gets or sets the underlying SocketTasks.
13+
/// </summary>
14+
/// <value>The tasks.</value>
815
public SocketTask[] Tasks { get; set; }
916

10-
public bool IsDone
17+
/// <summary>
18+
/// Gets a value indicating whether this all tasks is done.
19+
/// </summary>
20+
/// <value><c>true</c> if is done; otherwise, <c>false</c>.</value>
21+
public bool IsDone
1122
{
1223
get
1324
{
@@ -23,6 +34,10 @@ public bool IsDone
2334
}
2435
}
2536

37+
/// <summary>
38+
/// Gets a value indicating whether all tasks were sucessful.
39+
/// </summary>
40+
/// <value><c>true</c> if success; otherwise, <c>false</c>.</value>
2641
public bool Success
2742
{
2843
get
@@ -39,6 +54,10 @@ public bool Success
3954
}
4055
}
4156

57+
/// <summary>
58+
/// Gets a value indicating whether any tasks were successful.
59+
/// </summary>
60+
/// <value><c>true</c> if any success; otherwise, <c>false</c>.</value>
4261
public bool AnySuccess
4362
{
4463
get
@@ -55,6 +74,10 @@ public bool AnySuccess
5574
}
5675
}
5776

77+
/// <summary>
78+
/// Gets a value indicating whether any tasks are done.
79+
/// </summary>
80+
/// <value><c>true</c> if any done; otherwise, <c>false</c>.</value>
5881
public bool AnyDone
5982
{
6083
get
@@ -72,19 +95,54 @@ public bool AnyDone
7295
}
7396
}
7497

98+
/// <summary>
99+
/// A single socket task.
100+
/// </summary>
75101
public class SocketTask
76102
{
77103
// Used for states
104+
/// <summary>
105+
/// Gets or sets a value indicating whether this <see cref="T:MLAPI.Transports.Tasks.SocketTask"/> is done.
106+
/// </summary>
107+
/// <value><c>true</c> if is done; otherwise, <c>false</c>.</value>
78108
public bool IsDone { get; set; }
109+
/// <summary>
110+
/// Gets or sets a value indicating whether this <see cref="T:MLAPI.Transports.Tasks.SocketTask"/> is success.
111+
/// </summary>
112+
/// <value><c>true</c> if success; otherwise, <c>false</c>.</value>
79113
public bool Success { get; set; }
80114

81115
// These are all set by the transport
116+
/// <summary>
117+
/// Gets or sets the transport exception.
118+
/// </summary>
119+
/// <value>The transport exception.</value>
82120
public Exception TransportException { get; set; }
121+
/// <summary>
122+
/// Gets or sets the socket error.
123+
/// </summary>
124+
/// <value>The socket error.</value>
83125
public SocketError SocketError { get; set; }
126+
/// <summary>
127+
/// Gets or sets the transport code.
128+
/// </summary>
129+
/// <value>The transport code.</value>
84130
public int TransportCode { get; set; }
131+
/// <summary>
132+
/// Gets or sets the message.
133+
/// </summary>
134+
/// <value>The message.</value>
85135
public string Message { get; set; }
136+
/// <summary>
137+
/// Gets or sets the state.
138+
/// </summary>
139+
/// <value>The state.</value>
86140
public object State { get; set; }
87141

142+
/// <summary>
143+
/// Gets a done task.
144+
/// </summary>
145+
/// <value>The done.</value>
88146
public static SocketTask Done => new SocketTask()
89147
{
90148
IsDone = true,
@@ -96,6 +154,10 @@ public class SocketTask
96154
TransportException = null
97155
};
98156

157+
/// <summary>
158+
/// Gets a faulty task.
159+
/// </summary>
160+
/// <value>The fault.</value>
99161
public static SocketTask Fault => new SocketTask()
100162
{
101163
IsDone = true,
@@ -107,6 +169,10 @@ public class SocketTask
107169
TransportException = null
108170
};
109171

172+
/// <summary>
173+
/// Gets a working task.
174+
/// </summary>
175+
/// <value>The working.</value>
110176
public static SocketTask Working => new SocketTask()
111177
{
112178
IsDone = false,
@@ -118,6 +184,10 @@ public class SocketTask
118184
TransportException = null
119185
};
120186

187+
/// <summary>
188+
/// Converts to a SocketTasks.
189+
/// </summary>
190+
/// <returns>The tasks.</returns>
121191
public SocketTasks AsTasks()
122192
{
123193
return new SocketTasks()

MLAPI/Transports/Transport.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public abstract class Transport : MonoBehaviour
6464
}
6565
};
6666

67+
/// <summary>
68+
/// Delegate for transport events.
69+
/// </summary>
6770
public delegate void TransportEventDelegate(NetEventType type, ulong clientId, string channelName, ArraySegment<byte> payload, float receiveTime);
6871

6972
/// <summary>
@@ -105,7 +108,7 @@ public abstract class Transport : MonoBehaviour
105108
/// </summary>
106109
/// <param name="clientId">The clientId to disconnect</param>
107110
public abstract void DisconnectRemoteClient(ulong clientId);
108-
111+
109112
/// <summary>
110113
/// Disconnects the local client from the server
111114
/// </summary>
@@ -117,7 +120,7 @@ public abstract class Transport : MonoBehaviour
117120
/// <param name="clientId">The clientId to get the rtt from</param>
118121
/// <returns>Returns the round trip time in milliseconds </returns>
119122
public abstract ulong GetCurrentRtt(ulong clientId);
120-
123+
121124
/// <summary>
122125
/// Shuts down the transport
123126
/// </summary>

0 commit comments

Comments
 (0)