terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
UdpClient.cs
Go to the documentation of this file.
1using System;
5
6namespace System.Net.Sockets
7{
8 // Token: 0x02000307 RID: 775
9 public class UdpClient : IDisposable
10 {
11 // Token: 0x06001427 RID: 5159 RVA: 0x0003DA20 File Offset: 0x0003BC20
12 public UdpClient()
13 {
14 }
15
16 // Token: 0x06001428 RID: 5160 RVA: 0x0003DA30 File Offset: 0x0003BC30
18 {
19 this.m_Family = AddressFamily.InterNetwork;
20 base..ctor();
22 this.createClientSocket();
23 }
24
25 // Token: 0x06001429 RID: 5161 RVA: 0x0003DA60 File Offset: 0x0003BC60
26 public UdpClient(int port)
27 {
28 }
29
30 // Token: 0x0600142A RID: 5162 RVA: 0x0003DA70 File Offset: 0x0003BC70
31 public UdpClient(int port, AddressFamily family)
32 {
33 this.m_Family = AddressFamily.InterNetwork;
34 base..ctor();
35 if (2 == 0)
36 {
37 }
38 bool flag = ValidationHelper.ValidateTcpPort(port);
40 if (2 == 0)
41 {
42 }
43 }
44
45 // Token: 0x17000490 RID: 1168
46 // (get) Token: 0x0600142B RID: 5163 RVA: 0x0003DAB8 File Offset: 0x0003BCB8
47 // (set) Token: 0x0600142C RID: 5164 RVA: 0x0003DACC File Offset: 0x0003BCCC
49 {
50 get
51 {
52 return this.m_ClientSocket;
53 }
54 set
55 {
57 }
58 }
59
60 // Token: 0x17000491 RID: 1169
61 // (set) Token: 0x0600142D RID: 5165 RVA: 0x0003DAE0 File Offset: 0x0003BCE0
62 public bool EnableBroadcast
63 {
64 set
65 {
67 }
68 }
69
70 // Token: 0x0600142E RID: 5166 RVA: 0x0003DAFC File Offset: 0x0003BCFC
71 public void Close()
72 {
73 }
74
75 // Token: 0x0600142F RID: 5167 RVA: 0x0003DB0C File Offset: 0x0003BD0C
76 private void FreeResources()
77 {
78 if (!this.m_CleanedUp)
79 {
81 if (clientSocket != null)
82 {
84 clientSocket.Close();
85 }
86 this.m_CleanedUp = true;
87 }
88 }
89
90 // Token: 0x06001430 RID: 5168 RVA: 0x0003DB40 File Offset: 0x0003BD40
91 public void Dispose()
92 {
93 }
94
95 // Token: 0x06001431 RID: 5169 RVA: 0x0003DB50 File Offset: 0x0003BD50
96 protected virtual void Dispose(bool disposing)
97 {
98 this.FreeResources();
99 GC.SuppressFinalize(this);
100 }
101
102 // Token: 0x06001432 RID: 5170 RVA: 0x0003DB6C File Offset: 0x0003BD6C
104 {
105 if (this.m_ClientSocket != null && !this.m_IsBroadcast)
106 {
107 bool flag = UdpClient.IsBroadcast(ipAddress);
109 this.m_IsBroadcast = true;
110 clientSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);
111 return;
112 }
113 }
114
115 // Token: 0x06001433 RID: 5171 RVA: 0x0003DBB0 File Offset: 0x0003BDB0
116 private static bool IsBroadcast(IPAddress address)
117 {
118 /*
119An exception occurred when decompiling this method (06001433)
120
121ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean System.Net.Sockets.UdpClient::IsBroadcast(System.Net.IPAddress)
122
123 ---> System.Exception: Basic block has to end with unconditional control flow.
124{
125 IL_0000:
126 brtrue(IL_0000, ldc.i4:bool(1))
127}
128
129 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
130 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
131 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
132 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
133 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
134 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
135 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
136 --- End of inner exception stack trace ---
137 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
138 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
139*/;
140 }
141
142 // Token: 0x06001434 RID: 5172 RVA: 0x0003DBC4 File Offset: 0x0003BDC4
143 public int Send(byte[] dgram, int bytes, IPEndPoint endPoint)
144 {
145 /*
146An exception occurred when decompiling this method (06001434)
147
148ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 System.Net.Sockets.UdpClient::Send(System.Byte[],System.Int32,System.Net.IPEndPoint)
149
150 ---> System.Exception: Basic block has to end with unconditional control flow.
151{
152 IL_0042:
153 stloc:string(var_6_4C, call:string(SR::GetString, ldstr:string("Cannot send packets to an arbitrary host while connected.")))
154}
155
156 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
157 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
158 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
159 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
160 --- End of inner exception stack trace ---
161 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
162 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
163*/;
164 }
165
166 // Token: 0x06001435 RID: 5173 RVA: 0x0003DC20 File Offset: 0x0003BE20
167 public IAsyncResult BeginReceive(AsyncCallback requestCallback, object state)
168 {
169 /*
170An exception occurred when decompiling this method (06001435)
171
172ICSharpCode.Decompiler.DecompilerException: Error decompiling System.IAsyncResult System.Net.Sockets.UdpClient::BeginReceive(System.AsyncCallback,System.Object)
173
174 ---> System.Exception: Basic block has to end with unconditional control flow.
175{
176 IL_0025:
177 stloc:Type(var_5_2B, call:Type(object::GetType, ldloc:UdpClient[exp:object](this)))
178}
179
180 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
181 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
182 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
183 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
184 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
185 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
186 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
187 --- End of inner exception stack trace ---
188 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
189 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
190*/;
191 }
192
193 // Token: 0x06001436 RID: 5174 RVA: 0x0003DC5C File Offset: 0x0003BE5C
194 public byte[] EndReceive(IAsyncResult asyncResult, IPEndPoint remoteEP)
195 {
196 bool cleanedUp;
197 do
198 {
199 cleanedUp = this.m_CleanedUp;
200 }
201 while (cleanedUp);
203 if (!cleanedUp)
204 {
205 }
206 int num = this.m_ClientSocket.EndReceiveFrom(asyncResult, remoteEP);
207 throw new InvalidCastException();
208 }
209
210 // Token: 0x06001437 RID: 5175 RVA: 0x00002050 File Offset: 0x00000250
212 {
213 throw new global::Cpp2IlInjected.AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
214 }
215
216 // Token: 0x06001438 RID: 5176 RVA: 0x0003DC98 File Offset: 0x0003BE98
217 private void createClientSocket()
218 {
220 }
221
222 // Token: 0x06001439 RID: 5177 RVA: 0x0003DCAC File Offset: 0x0003BEAC
225 {
226 return this.BeginReceive(callback, state);
227 }
228
229 // Token: 0x0600143A RID: 5178 RVA: 0x00002050 File Offset: 0x00000250
232 {
233 throw new global::Cpp2IlInjected.AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
234 }
235
236 // Token: 0x040010D9 RID: 4313
238
239 // Token: 0x040010DA RID: 4314
240 private bool m_Active;
241
242 // Token: 0x040010DB RID: 4315
243 private byte[] m_Buffer;
244
245 // Token: 0x040010DC RID: 4316
247
248 // Token: 0x040010DD RID: 4317
249 private bool m_CleanedUp;
250
251 // Token: 0x040010DE RID: 4318
252 private bool m_IsBroadcast;
253 }
254}
class f__AnonymousType0<< Count > j__TPar
static void SuppressFinalize(object obj)
Definition GC.cs:116
void SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, int optionValue, bool silent)
Definition Socket.cs:500
int EndReceiveFrom(IAsyncResult asyncResult, EndPoint endPoint)
Definition Socket.cs:1352
void InternalShutdown(SocketShutdown how)
Definition Socket.cs:490
int Send(byte[] dgram, int bytes, IPEndPoint endPoint)
Definition UdpClient.cs:143
void CheckForBroadcast(IPAddress ipAddress)
Definition UdpClient.cs:103
static bool IsBroadcast(IPAddress address)
Definition UdpClient.cs:116
UdpReceiveResult< ReceiveAsync > b__65_1(IAsyncResult ar)
Definition UdpClient.cs:231
UdpClient(int port, AddressFamily family)
Definition UdpClient.cs:31
IAsyncResult< ReceiveAsync > b__65_0(AsyncCallback callback, object state)
Definition UdpClient.cs:224
Task< UdpReceiveResult > ReceiveAsync()
Definition UdpClient.cs:211
byte[] EndReceive(IAsyncResult asyncResult, IPEndPoint remoteEP)
Definition UdpClient.cs:194
UdpClient(AddressFamily family)
Definition UdpClient.cs:17
IAsyncResult BeginReceive(AsyncCallback requestCallback, object state)
Definition UdpClient.cs:167
virtual void Dispose(bool disposing)
Definition UdpClient.cs:96
static bool ValidateTcpPort(int port)