Trying to perform the equivalent c# code in Clojure CLR
using System.Net;
IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0);
EndPoint remote = (EndPoint) sender;
recv = sock.ReceiveFrom(data, ref remote);
What I've tried in Clojure that does not work:
(let [
sender (IPEndPoint. (IPAddress/Any) 0)
^EndPoint remote ^EndPoint sender
recv (.ReceiveFrom sock data (by-ref remote))
]
(println (.ToString remote))
;; Do something with data...
)
It just shows 0.0.0.0:0 I'm thinking the ref is not working but also not sure of the hint / cast syntax.
I've looked at here for info on ref https://github.com/richhickey/clojure-clr/wiki/CLR-Interop And here about specifying types: https://github.com/clojure/clojure-clr/wiki/Specifying-types