views:

162

answers:

3

Hello everybody

I'm trying to manually create the file descriptor associated with a socket in python and then loaded directly into memory with mmap. Create a file into memory with mmap is simple, but I can not find a way to associate the file with a socket.

Anyone know how?

thank you very much.

+1  A: 

Why do you want to load this into memory using mmap? If you are on a unix variant, you can create a unix socket which is a file descriptor which can be used just like any other socket. A socket and a memory-mapped file are two distinct entities - it is probably not a good idea to try and mix them.

Perhaps it would be helpful to take a step back and discuss what you are trying to do at a higher level.

Justin Ethier
A: 
Jeremy Brown
A: 

Thanks for your responses.

The problem I have is I can not make more of a number of sockets for python (or operating system) I get the error: "[errno 24] Too many open files."

I think the error is because I can not create more file descriptors on disk, so I want to create them in memory. To avoid this limitation.

any suggestions?

thank you very much, again.

Dani
Please see the last edit to my post. Hope this helps!
Jeremy Brown