Closed jfontsaballs closed 5 years ago
I will have to make a custom exception for it to support it. so i will suggest doing the following which is going to have been something similar i will have done to wrap it in IL until i have a support for writing custom serializer for non object type.
class IPAddressWrapper {
public string Value {get; private set;}
public IPAddress Address => System.Net.IPAddress.Parse(this.Value);
public IPAddressWrapper(){}
public IPAddressWrapper(IPAddress ipAddress){
this.Value = ipAddress.ToString();
}
}
var myIpAddress = System.Net.IPAddress.Parse("192.168.1.1");
// Save IPAddress
String s = NetJSON.Serialize(new IPAddressWrapper(myIpAddress));
// Retrieve IPAddress
var ipAddress = NetJSON.Deserialize<IPAddressWrapper>(s).Address;
Let me know if the above makes sense. Thanks
The solution you suggest is a bit hacky but it makes sense, thank you.
Just started using your serializer for the first time. We decided for it because we are working on a project which makes heavy use of serialization and we are very interested in good performance.
Right now the only feature we miss is the ability to define custom serializers to handle special types, however, thank you for your work.
I have support for custom type serializer. But it is only handle on object type. You can go ahead and create a ticket for me to extend it to all types.
Thanks,
Hello,
I would like to serialize a System.Net.IPAddress object, but I get a SocketException with error code 10045.
Example code:
Thank-you.