net.accept()

classic Classic list List threaded Threaded
7 messages Options
gduarte gduarte
Reply | Threaded
Open this post in threaded view
|

net.accept()

Hello guys!

I have been observing that we can't reuse a socket at net.accept, because it creates a new socket every single call, but, we know that eLua's networkl layer has some faults about opening more than 3 or 4 sockets at the same time.

So, why not use the net.socket call to create a socket and use it at net.accept as a parameter???

This way we could reuse a socket and use a keep-alive architecture instead of grab a socket, close it, reopen, etc...

What you say about it?

Cheers!

--
Gabriel Duarte
Linux User #471185
Rio de Janeiro / RJ
http://genericdev.wordpress.com/

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
gduarte gduarte
Reply | Threaded
Open this post in threaded view
|

Re: net.accept()

No comments?


2013/4/21 Gabriel Duarte <[hidden email]>
Hello guys!

I have been observing that we can't reuse a socket at net.accept, because it creates a new socket every single call, but, we know that eLua's networkl layer has some faults about opening more than 3 or 4 sockets at the same time.

So, why not use the net.socket call to create a socket and use it at net.accept as a parameter???

This way we could reuse a socket and use a keep-alive architecture instead of grab a socket, close it, reopen, etc...

What you say about it?

Cheers!

--
Gabriel Duarte
Linux User #471185
Rio de Janeiro / RJ
http://genericdev.wordpress.com/



--
Gabriel Duarte
Linux User #471185
Rio de Janeiro / RJ
http://genericdev.wordpress.com/

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
sweetlilmre sweetlilmre
Reply | Threaded
Open this post in threaded view
|

Re: net.accept()

AFAIK sockets are not reuse-able in this way.
A call to accept in a BSD socket architecture will always create a new socket, see: http://linux.die.net/man/2/accept

Keep-alive is a completely different concept: the same connection is kept alive for additional requests to the server.

HTH
-(e)


On Fri, Apr 26, 2013 at 1:59 AM, Gabriel Duarte <[hidden email]> wrote:
No comments?


2013/4/21 Gabriel Duarte <[hidden email]>
Hello guys!

I have been observing that we can't reuse a socket at net.accept, because it creates a new socket every single call, but, we know that eLua's networkl layer has some faults about opening more than 3 or 4 sockets at the same time.

So, why not use the net.socket call to create a socket and use it at net.accept as a parameter???

This way we could reuse a socket and use a keep-alive architecture instead of grab a socket, close it, reopen, etc...

What you say about it?

Cheers!

--
Gabriel Duarte
Linux User #471185
Rio de Janeiro / RJ
http://genericdev.wordpress.com/



--
Gabriel Duarte
Linux User #471185
Rio de Janeiro / RJ
http://genericdev.wordpress.com/

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
gduarte gduarte
Reply | Threaded
Open this post in threaded view
|

Re: net.accept()

It's true... sorry for the dumb question.


2013/4/26 Peter Edwards <[hidden email]>
AFAIK sockets are not reuse-able in this way.
A call to accept in a BSD socket architecture will always create a new socket, see: http://linux.die.net/man/2/accept

Keep-alive is a completely different concept: the same connection is kept alive for additional requests to the server.

HTH
-(e)


On Fri, Apr 26, 2013 at 1:59 AM, Gabriel Duarte <[hidden email]> wrote:
No comments?


2013/4/21 Gabriel Duarte <[hidden email]>
Hello guys!

I have been observing that we can't reuse a socket at net.accept, because it creates a new socket every single call, but, we know that eLua's networkl layer has some faults about opening more than 3 or 4 sockets at the same time.

So, why not use the net.socket call to create a socket and use it at net.accept as a parameter???

This way we could reuse a socket and use a keep-alive architecture instead of grab a socket, close it, reopen, etc...

What you say about it?

Cheers!

--
Gabriel Duarte
Linux User #471185
Rio de Janeiro / RJ
http://genericdev.wordpress.com/



--
Gabriel Duarte
Linux User #471185
Rio de Janeiro / RJ
http://genericdev.wordpress.com/

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



--
Gabriel Duarte
Linux User #471185
Rio de Janeiro / RJ
http://genericdev.wordpress.com/

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
sweetlilmre sweetlilmre
Reply | Threaded
Open this post in threaded view
|

Re: net.accept()

No such thing as a dumb question :)

On 6 May 2013 21:11, "Gabriel Duarte" <[hidden email]> wrote:
It's true... sorry for the dumb question.


2013/4/26 Peter Edwards <[hidden email]>
AFAIK sockets are not reuse-able in this way.
A call to accept in a BSD socket architecture will always create a new socket, see: http://linux.die.net/man/2/accept

Keep-alive is a completely different concept: the same connection is kept alive for additional requests to the server.

HTH
-(e)


On Fri, Apr 26, 2013 at 1:59 AM, Gabriel Duarte <[hidden email]> wrote:
No comments?


2013/4/21 Gabriel Duarte <[hidden email]>
Hello guys!

I have been observing that we can't reuse a socket at net.accept, because it creates a new socket every single call, but, we know that eLua's networkl layer has some faults about opening more than 3 or 4 sockets at the same time.

So, why not use the net.socket call to create a socket and use it at net.accept as a parameter???

This way we could reuse a socket and use a keep-alive architecture instead of grab a socket, close it, reopen, etc...

What you say about it?

Cheers!

--
Gabriel Duarte
Linux User #471185
Rio de Janeiro / RJ
http://genericdev.wordpress.com/



--
Gabriel Duarte
Linux User #471185
Rio de Janeiro / RJ
http://genericdev.wordpress.com/

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



--
Gabriel Duarte
Linux User #471185
Rio de Janeiro / RJ
http://genericdev.wordpress.com/

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
hrh1818 hrh1818
Reply | Threaded
Open this post in threaded view
|

Re: net.accept()

gduarte gduarte
Reply | Threaded
Open this post in threaded view
|

Re: net.accept()

I think that you could open a new thread with this proposition :D Maybe someone can port it!!

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev