Crash when using sockets

F

First Last

whenever I try to use the following socket, an error window pops up
saying rubyw.exe has requested the runtime to teminate it in an unusual
way. I am running XP SP2 and ruby-1.8.6.

the socket i try to open is the following:
@s = Socket.open(Socket::pF_INET, Socket::SOCK_RAW, Socket::IPPROTO_RAW)

anyone have an explination?
 
S

Stefan Mahlitz

First said:
whenever I try to use the following socket, an error window pops up
saying rubyw.exe has requested the runtime to teminate it in an unusual
way. I am running XP SP2 and ruby-1.8.6.

the socket i try to open is the following:
@s = Socket.open(Socket::pF_INET, Socket::SOCK_RAW, Socket::IPPROTO_RAW)

anyone have an explination?

I have the same but with ruby 1.8.5

Maybe it is related to this:

http://www.interact-sw.co.uk/iangblog/2004/08/12/norawsockets

Anyway - with linux the code raises the exception with my standard user
(which I think is sensible)

Errno::EPERM: Operation not permitted - socket(2)

and returns a socket when run as root

=> #<Socket:0x2afa764df288>

Some of the posts (your favourite search engine will have bunches of
hits) did suggest that disabling firewall and firewall-service will
reenable raw-sockets, but I didn't try this.

Sorry, I do not have a solution - only a possible explanation.

Stefan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,264
Messages
2,571,314
Members
47,993
Latest member
Meri511146

Latest Threads

Top