Speed up file transfers

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
aserto
Posts: 22
Joined: Mon Apr 17, 2006 10:38 pm

Speed up file transfers

Post by aserto »

I'm writing an irc client. I'have just added the dcc support. But the file transfer is very slow... here is the code:

Code: Select all

                    while true do
                        --if string.len(buffer)>0 then    
                            buffer = dcc:recv()
                            rbytes=rbytes+string.len(buffer)
                            file=io.open(conf.downdir..garg[3], "a")
                            if not file then
                                table.insert(chattext[tabnum], "* Error: DCC RECV failed.")
                                dcc:close()
                                break
                            end
                            file:write(buffer)
                            file:close()
                            if finished==true then
                                System.sleep(100)
                                dcc:close()
                                table.insert(chattext[tabnum], "* DCC RECV completed.")
                                break
                            end
                            if rbytes==tonumber(garg[5]) then
                                --send finished
                                finished=true
                                --dcc:close()
                                --break
                            end
                        --end
                    end
Any suggestions to speed up this?
puffo83
Posts: 4
Joined: Fri Jun 02, 2006 1:18 am

Post by puffo83 »

I use another method!
Please Check the post "Load Image from Array of Bytes":

http://forums.ps2dev.org/viewtopic.php? ... 72a313f58a

The time of saving a jpg file is good by is to slow to continues send from wi-fi!
If you have any suggestions, please response me! ;)! ;)
Post Reply