question

Upvotes
Accepted
301 6 17 27

RFA.NET RequestToken question

We are using RFA.NET 8 develops Provider application and we use requestToken.GetHashCode() to log the requestTokens that the provider received from ADH. However sometime we see duplicated value from GetHashCode method while the first request received the same value still active. Currently we do not recieve any error in the provider but we would like to confirm that

-Is it possible for different Client session to create the same RequestToken ? and Is the RequestToken value unique across servers ?

treprfarfa-apirequest-token
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
Accepted
7.6k 15 6 9

@Rupert Schilling

The Request Tokens are unique across client sessions. Actually GetHashCode method does not returns actual value of requestToken. RFA.NET keep the actual value in some internal variable. Howvever the duplicate value appears to be a collision in the getHashCode method.

RFA.NET RequestToken.GetHashCode() calls ((long)_RequestToken).ToString().GetHashCode(); which is .NET function to generate Hash Code. Based on the Note from MSDN, method ToString().GetHashCode() can generate collision value from difference string. It could be an issue mentioned in the document.

You should not use GetHashCode to differenciate RequestToken. If you found any issue after receive duplicate HashCode, please turn on RSSL logs and open ticket to API support to investigate issue further.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea