diff --git a/Esyur/Net/IIP/DistributedConnection.cs b/Esyur/Net/IIP/DistributedConnection.cs index a119978..24cf069 100644 --- a/Esyur/Net/IIP/DistributedConnection.cs +++ b/Esyur/Net/IIP/DistributedConnection.cs @@ -778,12 +778,23 @@ namespace Esyur.Net.IIP this.Socket.Hold(); - while (offset < ends) - { - offset = processPacket(msg, offset, ends, data, chunkId); - } - this.Socket.Unhold(); + try + { + while (offset < ends) + { + offset = processPacket(msg, offset, ends, data, chunkId); + } + } + catch (Exception ex) + { + Console.WriteLine(ex); + Console.Beep(); + } + finally + { + this.Socket.Unhold(); + } } /// diff --git a/Esyur/Net/Sockets/TCPSocket.cs b/Esyur/Net/Sockets/TCPSocket.cs index 912a5d4..7bad65b 100644 --- a/Esyur/Net/Sockets/TCPSocket.cs +++ b/Esyur/Net/Sockets/TCPSocket.cs @@ -445,8 +445,19 @@ namespace Esyur.Net.Sockets public void Unhold() { - DataSent(null); - held = false; + try + { + DataSent(null); + } + catch (Exception ex) + { + Console.WriteLine(ex); + Console.Beep(); + } + finally + { + held = false; + } } } } \ No newline at end of file diff --git a/Esyur/Proxy/ResourceProxy.cs b/Esyur/Proxy/ResourceProxy.cs index cd82404..d9ef2d0 100644 --- a/Esyur/Proxy/ResourceProxy.cs +++ b/Esyur/Proxy/ResourceProxy.cs @@ -129,10 +129,12 @@ namespace Esyur.Proxy Label exitMethod = g.DefineLabel(); Label callModified = g.DefineLabel(); + g.Emit(OpCodes.Nop); + g.Emit(OpCodes.Ldarg_0); g.Emit(OpCodes.Ldarg_1); g.Emit(OpCodes.Call, pi.GetSetMethod()); - //g.Emit(OpCodes.Nop); + g.Emit(OpCodes.Nop); g.Emit(OpCodes.Ldarg_0); g.Emit(OpCodes.Call, getInstance); @@ -154,13 +156,19 @@ namespace Esyur.Proxy propertyBuilder.SetSetMethod(builder); - // builder = typeBuilder.DefineMethod("get_" + pi.Name, MethodAttributes.Public | MethodAttributes.Virtual, pi.PropertyType, null); - // g = builder.GetILGenerator(); - // g.Emit(OpCodes.Ldarg_0); - // g.Emit(OpCodes.Call, pi.GetGetMethod()); - // g.Emit(OpCodes.Ret); + builder = typeBuilder.DefineMethod("get_" + pi.Name, MethodAttributes.Public | MethodAttributes.Virtual, pi.PropertyType, null); + g = builder.GetILGenerator(); + g.Emit(OpCodes.Ldarg_0); + g.Emit(OpCodes.Call, pi.GetGetMethod()); + g.Emit(OpCodes.Ret); - // propertyBuilder.SetGetMethod(builder); + propertyBuilder.SetGetMethod(builder); + + // g.Emit(OpCodes.Ldarg_0); + // g.Emit(OpCodes.Call, pi.GetGetMethod()); + // g.Emit(OpCodes.Ret); + + // propertyBuilder.SetGetMethod(builder); /*