forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Speed up file transfers

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
aserto



Joined: 17 Apr 2006
Posts: 22

PostPosted: Fri Jun 02, 2006 10:11 pm    Post subject: Speed up file transfers Reply with quote

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:

                    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?
Back to top
View user's profile Send private message
puffo83



Joined: 02 Jun 2006
Posts: 4

PostPosted: Sat Jun 03, 2006 1:05 am    Post subject: Reply with quote

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

http://forums.ps2dev.org/viewtopic.php?t=5872&sid=7526d9fcbb95098978fab172a313f58a

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! ;)! ;)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group