-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor EndpointInfo in C# #3185
Conversation
/// <returns>True if the endpoint is secure.</returns> | ||
public abstract bool secure(); | ||
/// <remarks>The type of an underlying endpoint is always the same as the type its enclosing endpoint.</remarks> | ||
public virtual short type() => underlying?.type() ?? -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we instead assert underlying is not null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even with a Debug.Assert, we would still need to return something. So I think -1 is fine here.
info.timeout = info.underlying.timeout; | ||
return info; | ||
} | ||
public override EndpointInfo getInfo() => new WSEndpointInfo(_delegate.getInfo(), _resource); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me how the secure, type, datagram, timeout, compress fields of this returned WSEndpointInfo
are set.
They should be set to the underlying endpoint info values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it works similar to how it did before, the difference is that type()
, secure()
, .. are called once when constructed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the base class, Ice.EndpointInfo.
type(), datagram() and secure() delegate to underlying, while the timeout and compress fields are set in the constructor from underlying.
This PR simplifies EndpointInfo in C#, in particular, make all the fields readonly.