{Missing}
Hey there all'
{Missing}
anyone ok of a good please to read up on tuts about this? coroutines really confusers me but I need to make a client that is also the server like a p2p where
the user logins in there IP is loged a friend logs in that IP is loged then the 2 can connect without the server once both saids as the IP's I want to make a text
based game that will still work in the future when the main host is dead/down or just no longer offering the user login as it will have a manual connect also, this wont be made in love but it is made in lua so if anyone as any tuts they know of to help out it be great
coroutines really makes me gets to my head I tried using it many times and failed lol
Edit:
Old
anyone ok of a good please to read up on tuts about this?
new
As anyone got any good places to read up on tuts about this?
Lua + Sockets + coroutines
Lua + Sockets + coroutines
Last edited by crow on Wed Mar 23, 2011 12:18 pm, edited 1 time in total.
Sir Kittenface
Möko IDE Codename (Erös) Returns Soon
I am dyslexic so if any of my replys confusing please just ask me to reword it as this will make things a lot easier for all parties lol.
Möko IDE Codename (Erös) Returns Soon
I am dyslexic so if any of my replys confusing please just ask me to reword it as this will make things a lot easier for all parties lol.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Lua + Sockets + coroutines
Do you want resources on how to use luasocket with coroutines, or both resources on luasocket and resources on coroutines, separately?
As for the long question without any punctuation, to connect you need to know what to connect to, so I guess what you want to do is use the host to give the clients contact information of the others, so they can set up individual connections, but this seems rather tricky to get right in my untrained eyes.
As for the long question without any punctuation, to connect you need to know what to connect to, so I guess what you want to do is use the host to give the clients contact information of the others, so they can set up individual connections, but this seems rather tricky to get right in my untrained eyes.
Help us help you: attach a .love.
Re: Lua + Sockets + coroutines
Well if you know tuts on both just link them sure they would help and sure it will help others also.Robin wrote:Do you want resources on how to use luasocket with coroutines, or both resources on luasocket and resources on coroutines, separately?
Robin your getting rude now and downgrading please don't bring it up again its unfair yes I have learning problems you said you peace more then once now leave it out please, I had to redo this about 5 time as you really got on my tit on this one.Robin wrote: As for the long question without any punctuation,
Robin wrote: to connect you need to know what to connect to, so I guess what you want to do is use the host to give the
clients contact information of the others, so they can set up individual connections, but this seems rather tricky to get right in my untrained eyes.
Thats using HTTP but I give the hole thing a read I sure this will be useful also thanks vrld
PHP would handle the users and the IP address to connected to thats not a problem and there would also be a direct connect option where if you know your friends IP to connect to
Sir Kittenface
Möko IDE Codename (Erös) Returns Soon
I am dyslexic so if any of my replys confusing please just ask me to reword it as this will make things a lot easier for all parties lol.
Möko IDE Codename (Erös) Returns Soon
I am dyslexic so if any of my replys confusing please just ask me to reword it as this will make things a lot easier for all parties lol.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Lua + Sockets + coroutines
Maybe the luasocket introduction and reference would help?.
Okay. I was trying to help you, but if it is unwanted or doesn't work for you, I'll stop.crow wrote:Robin your getting rude now and downgrading please don't bring it up again its unfair yes I have learning problems you said you peace more then once now leave it out please, I had to redo this about 5 time as you really got on my tit on this one.Robin wrote: As for the long question without any punctuation,
Help us help you: attach a .love.
Re: Lua + Sockets + coroutines
If you want to use coroutines to prevent your app from blocking when sending/receiving things over the network then it won't work. Coroutines are a kind of cooperative multitask, so if one coroutine blocks the entire app blocks.
To prevent a network connection from blocking you'll need either socket.select or Lua threads.
Cheers,
Andre
To prevent a network connection from blocking you'll need either socket.select or Lua threads.
Cheers,
Andre
Re: Lua + Sockets + coroutines
Only half of the truth. You can use nonblocking network IO using a timeout of 0. Like chapter 9.4 of the PIL demonstrates.leiradel wrote:If you want to use coroutines to prevent your app from blocking when sending/receiving things over the network then it won't work.
Re: Lua + Sockets + coroutines
That's correct, sorry for not mentioning it.vrld wrote:Only half of the truth. You can use nonblocking network IO using a timeout of 0.
EDIT: Since there are three possible solution to the blocking IO issue, I think my post qualifies for 2/3 of the truth
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Lua + Sockets + coroutines
Still, you cannot use coroutines for that purpose.vrld wrote:Only half of the truth. You can use nonblocking network IO using a timeout of 0. Like chapter 9.4 of the PIL demonstrates.leiradel wrote:If you want to use coroutines to prevent your app from blocking when sending/receiving things over the network then it won't work.
You can use nonblocking IO to prevent from blocking, but coroutines don't do anything about that. To say you can use coroutines to prevent your app from blocking is like saying you can use PO2 images to prevent your app from blocking: sure, if you use coroutines/PO2 images and an actual solution it'll work, but the same will happen if you don't use coroutines/PO2 images.
Help us help you: attach a .love.
Re: Lua + Sockets + coroutines
I will be making this in AMS and the exe does not offer threads I hear coroutines or Lans can offer lua like threads. Coroutines could be wrong thing to use I just been reading the ways to have it to work
I have a way to do it a simple way but its not a free way that offers sockets that don't lock up but luasockets will make it easyer for people to port to another OS.
thanks guys i still reading anyone know of a dedicated p2p script in lua ?
I have a way to do it a simple way but its not a free way that offers sockets that don't lock up but luasockets will make it easyer for people to port to another OS.
thanks guys i still reading anyone know of a dedicated p2p script in lua ?
Sir Kittenface
Möko IDE Codename (Erös) Returns Soon
I am dyslexic so if any of my replys confusing please just ask me to reword it as this will make things a lot easier for all parties lol.
Möko IDE Codename (Erös) Returns Soon
I am dyslexic so if any of my replys confusing please just ask me to reword it as this will make things a lot easier for all parties lol.
Who is online
Users browsing this forum: No registered users and 5 guests