• gm_ezsock networking socket
    34 replies, posted
[QUOTE=danielga;38330832]This won't work for UDP because it is an unreliable protocol. You either read a whole packet or you don't. After reading even a SMALL part of an UDP packet, it will be discarded right away.[/QUOTE] Ehm, How about I make a TryRead(1024), and that it reads whatever there is, and inserts it. And returns that in a packet, where you can check with the DataLeft() if it has received something?
Added Sock:TryRead(num), and packet:InSize()!
To clear the things about how GLSock works, first of all the Think hook is only fetching data from a seperate thread. Why? Because GLSock is fully asynchronous for each call, every call is being processed in the seperate thread and the Think hook delievers a method to Poll the data from the other thread. Its performance is overall better this way. Edit: One a side note: The callback is already prepared when my Think hook is being called it just passes the lua handle over to push the data back. Its far different from EzSock
Sorry, you need to Log In to post a reply to this thread.