+2010-05-19 Atsushi Enomoto <atsushi@ximian.com>
+
+ * ServiceSettingsResponseInfo.cs
+ RegisterResponseInfo.cs
+ RefreshResponseInfo.cs
+ ResolveInfo.cs
+ UpdateInfo.cs
+ RegisterInfo.cs
+ UnregisterInfo.cs
+ RefreshInfo.cs
+ ResolveResponseInfo.cs : they don't have field initialization at
+ constructor now, for FormatterServices.GetUninitializedObject().
+ Fix regression with related to serialization changes.
+
2009-08-24 Atsushi Enomoto <atsushi@ximian.com>
* IPeerConnectorContract.cs : use common Constants class.
public class RefreshInfo
{
[MessageBodyMember (Name = "Refresh", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
+ RefreshInfoDC Body {
+ get {
+ if (body == null)
+ body = new RefreshInfoDC ();
+ return body;
+ }
+ }
RefreshInfoDC body;
public RefreshInfo ()
{
- body = new RefreshInfoDC ();
}
public RefreshInfo (string meshId, Guid regId)
: this ()
{
- body.MeshId = meshId;
- body.RegistrationId = regId;
+ Body.MeshId = meshId;
+ Body.RegistrationId = regId;
}
public string MeshId {
- get { return body.MeshId; }
+ get { return Body.MeshId; }
}
public Guid RegistrationId {
- get { return body.RegistrationId; }
+ get { return Body.RegistrationId; }
}
public bool HasBody ()
public class RefreshResponseInfo
{
[MessageBodyMember (Name = "RefreshResponse", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
+ RefreshResponseInfoDC Body {
+ get {
+ if (body == null)
+ body = new RefreshResponseInfoDC ();
+ return body;
+ }
+ }
RefreshResponseInfoDC body;
public RefreshResponseInfo ()
{
- body = new RefreshResponseInfoDC ();
}
public RefreshResponseInfo (TimeSpan registrationLifetime, RefreshResult result)
- : this ()
{
- body.RegistrationLifetime = registrationLifetime;
- body.Result = result;
+ Body.RegistrationLifetime = registrationLifetime;
+ Body.Result = result;
}
public TimeSpan RegistrationLifetime {
- get { return body.RegistrationLifetime; }
- set { body.RegistrationLifetime = value; }
+ get { return Body.RegistrationLifetime; }
+ set { Body.RegistrationLifetime = value; }
}
public RefreshResult Result {
- get { return body.Result; }
- set { body.Result = value; }
+ get { return Body.Result; }
+ set { Body.Result = value; }
}
public bool HasBody ()
public class RegisterInfo
{
[MessageBodyMember (Name = "Register", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
+ RegisterInfoDC Body {
+ get {
+ if (body == null)
+ body = new RegisterInfoDC ();
+ return body;
+ }
+ }
RegisterInfoDC body;
public RegisterInfo ()
{
- body = new RegisterInfoDC ();
}
public RegisterInfo (Guid client, string meshId, PeerNodeAddress address)
: this ()
{
- body.ClientId = client;
- body.MeshId = meshId;
- body.NodeAddress = address;
+ Body.ClientId = client;
+ Body.MeshId = meshId;
+ Body.NodeAddress = address;
}
public Guid ClientId {
- get { return body.ClientId; }
+ get { return Body.ClientId; }
}
public string MeshId {
- get { return body.MeshId; }
+ get { return Body.MeshId; }
}
public PeerNodeAddress NodeAddress {
- get { return body.NodeAddress; }
+ get { return Body.NodeAddress; }
}
public bool HasBody ()
public class RegisterResponseInfo
{
[MessageBodyMember (Name = "Update", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")] // .NET indeed returns "Update" element here.
+ RegisterResponseInfoDC Body {
+ get {
+ if (body == null)
+ body = new RegisterResponseInfoDC ();
+ return body;
+ }
+ }
RegisterResponseInfoDC body;
public RegisterResponseInfo ()
{
- body = new RegisterResponseInfoDC ();
}
public RegisterResponseInfo (Guid registrationId, TimeSpan registrationLifetime)
{
- body.RegistrationId = registrationId;
- body.RegistrationLifetime = registrationLifetime;
+ Body.RegistrationId = registrationId;
+ Body.RegistrationLifetime = registrationLifetime;
}
public Guid RegistrationId {
- get { return body.RegistrationId; }
- set { body.RegistrationId = value; }
+ get { return Body.RegistrationId; }
+ set { Body.RegistrationId = value; }
}
public TimeSpan RegistrationLifetime {
- get { return body.RegistrationLifetime; }
- set { body.RegistrationLifetime = value; }
+ get { return Body.RegistrationLifetime; }
+ set { Body.RegistrationLifetime = value; }
}
public bool HasBody ()
public class ResolveInfo
{
[MessageBodyMember (Name = "Resolve", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
+ ResolveInfoDC Body {
+ get {
+ if (body == null)
+ body = new ResolveInfoDC ();
+ return body;
+ }
+ }
ResolveInfoDC body;
public ResolveInfo ()
{
- body = new ResolveInfoDC ();
}
public ResolveInfo (Guid clientId, string meshId, int maxAddresses)
- : this ()
{
if (clientId == Guid.Empty)
throw new ArgumentException ("Empty Guid");
throw new ArgumentNullException ("meshId");
if (maxAddresses <= 0)
throw new ArgumentOutOfRangeException ("maxAddresses must be positive integer");
- body.ClientId = clientId;
- body.MeshId = meshId;
- body.MaxAddresses = maxAddresses;
+ Body.ClientId = clientId;
+ Body.MeshId = meshId;
+ Body.MaxAddresses = maxAddresses;
}
public Guid ClientId {
- get { return body.ClientId; }
+ get { return Body.ClientId; }
}
public int MaxAddresses {
- get { return body.MaxAddresses; }
+ get { return Body.MaxAddresses; }
}
public string MeshId {
- get { return body.MeshId; }
+ get { return Body.MeshId; }
}
public bool HasBody ()
public class ResolveResponseInfo
{
[MessageBodyMember (Name = "ResolveResponse", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
+ ResolveResponseInfoDC Body {
+ get {
+ if (body == null)
+ body = new ResolveResponseInfoDC ();
+ return body;
+ }
+ }
ResolveResponseInfoDC body;
-
+
public ResolveResponseInfo ()
{
- body = new ResolveResponseInfoDC ();
}
- public ResolveResponseInfo (PeerNodeAddress[] addresses)
+ public ResolveResponseInfo (PeerNodeAddress [] addresses)
{
- body.Addresses = new List<PeerNodeAddress> (addresses);
+ Body.Addresses = new List<PeerNodeAddress> (addresses);
}
public IList<PeerNodeAddress> Addresses {
- get { return body.Addresses; }
- set { body.Addresses = value; }
+ get { return Body.Addresses; }
+ set { Body.Addresses = value; }
}
public bool HasBody ()
public class ServiceSettingsResponseInfo
{
[MessageBodyMember (Name = "ServiceSettings", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
+ ServiceSettingsResponseInfoDC Body {
+ get {
+ if (body == null)
+ body = new ServiceSettingsResponseInfoDC ();
+ return body;
+ }
+ }
ServiceSettingsResponseInfoDC body;
public ServiceSettingsResponseInfo ()
{
- body = new ServiceSettingsResponseInfoDC ();
}
public ServiceSettingsResponseInfo (bool control)
- : this ()
{
- body.ControlMeshShape = control;
+ Body.ControlMeshShape = control;
}
public bool ControlMeshShape {
- get { return body.ControlMeshShape; }
- set { body.ControlMeshShape = value; }
+ get { return Body.ControlMeshShape; }
+ set { Body.ControlMeshShape = value; }
}
public bool HasBody ()
public class UnregisterInfo
{
[MessageBodyMember (Name = "Unregister", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
+ UnregisterInfoDC Body {
+ get {
+ if (body == null)
+ body = new UnregisterInfoDC ();
+ return body;
+ }
+ }
UnregisterInfoDC body;
public UnregisterInfo ()
{
- body = new UnregisterInfoDC ();
}
public UnregisterInfo (string meshId, Guid registration_id)
- : this ()
{
- body.MeshId = meshId;
- body.RegistrationId = registration_id;
+ Body.MeshId = meshId;
+ Body.RegistrationId = registration_id;
}
public string MeshId {
- get { return body.MeshId; }
+ get { return Body.MeshId; }
}
public Guid RegistrationId {
- get { return body.RegistrationId; }
+ get { return Body.RegistrationId; }
}
public bool HasBody ()
public class UpdateInfo
{
[MessageBodyMember (Name = "Update", Namespace = "http://schemas.microsoft.com/net/2006/05/peer")]
+ UpdateInfoDC Body {
+ get {
+ if (body == null)
+ body = new UpdateInfoDC ();
+ return body;
+ }
+ }
UpdateInfoDC body;
public UpdateInfo ()
{
- body = new UpdateInfoDC ();
}
public UpdateInfo (Guid registrationId, Guid client, string meshId, PeerNodeAddress address)
: this ()
{
- body.RegistrationId = registrationId;
- body.ClientId = client;
- body.MeshId = meshId;
- body.NodeAddress = address;
+ Body.RegistrationId = registrationId;
+ Body.ClientId = client;
+ Body.MeshId = meshId;
+ Body.NodeAddress = address;
}
public Guid ClientId {
- get { return body.ClientId; }
+ get { return Body.ClientId; }
}
public string MeshId {
- get { return body.MeshId; }
+ get { return Body.MeshId; }
}
public PeerNodeAddress NodeAddress {
- get { return body.NodeAddress; }
+ get { return Body.NodeAddress; }
}
public Guid RegistrationId {
- get { return body.RegistrationId; }
+ get { return Body.RegistrationId; }
}
public bool HasBody ()
+2010-05-19 Atsushi Enomoto <atsushi@ximian.com>
+
+ * PeerResolverSerializationTest.cs :
+ verify deserialized address count too.
+
2010-04-05 Atsushi Enomoto <atsushi@ximian.com>
* CustomPeerResolverServiceTest.cs : enabled all disabled tests.
using (var xw = XmlWriter.Create (sw))
ser.WriteObject (xw, rri);
rri = (ResolveResponseInfo) ser.ReadObject (XmlReader.Create (new StringReader (sw.ToString ())));
+ Assert.AreEqual (1, rri.Addresses.Count, "#1");
}
}