.net - How to initialize the Windows socket library without admin rights -


i'm writing program calls openoffice.org api through .net. documentation @ http://wiki.openoffice.org/wiki/documentation/devguide/prouno/cli/writing_client_programs says:

for ooo 3.x code this:

//c# example ooo 3.x //workaround needed when using socket connection //this initialize windows socket library. system.net.sockets.socket s = new system.net.sockets.socket( addressfamily.internetwork, sockettype.raw, protocoltype.ip); 

which works fine on windows xp , windows server 2003, on windows 7 fails with:

an attempt made access socket in way forbidden access permissions

which understand because socket type raw , program not running admin rights. question is: how can initialize windows socket library without admin rights?

access raw sockets requires admin rights on windows 2000 , later, , described on msdn:

tcp/ip raw sockets

raw sockets offer capability manipulate underlying transport, can used malicious purposes pose security threat. therefore, members of administrators group can create sockets of type sock_raw on windows 2000 , later.

...

note use socket of type sock_raw requires administrative privileges. users running winsock applications use raw sockets must member of administrators group on local computer, otherwise raw socket calls fail error code of wsaeacces. on windows vista , later, access raw sockets enforced @ socket creation. in earlier versions of windows, access raw sockets enforced during other socket operations.

there no way around restriction. on other hand, if intention initialize winsock in general, not need create raw socket that. create tcp (sockettype.stream , protocoltype.tcp) or udp (sockettype.dgram , protocoltype.udp) socket instead, not restricted, , ooo going use internally anyway. or, use pinvoke call winsock's wsastartup() function directly.


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -