c# - UDP Socket code in Clojure CLR -


i'm trying figure out proper syntax interop .net system.net.sockets. problem enumeration parts of arguments. here equivalent code in c#:

socket newsock = new socket(addressfamily.internetwork, sockettype.dgram, protocoltype.udp)

in clojure-clr i'm trying following:

(system.net.sockets.socket. (addressfamily/internetwork) (sockettype/dgram) (protocoltype/udp)) 

i'm getting compilerexception.invalidoperationexception. reviewed https://github.com/clojure/clojure-clr/wiki/working-with-enums regarding enum not understanding it.

i've tried:

(system.net.sockets.socket. (.internetwork addressfamily) (.dgram sockettype) (.udp protocoltype)) 

try following

(import [system.net.sockets socket addressfamily sockettype protocoltype]) (socket. addressfamily/internetwork sockettype/dgram protocoltype/udp) 

Popular posts from this blog