Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Send file via Socket

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
cleiton
Newbie cheater
Reputation: 0

Joined: 05 Mar 2014
Posts: 21

PostPosted: Sat Jul 12, 2014 2:15 pm    Post subject: Send file via Socket Reply with quote

Hi everyone,
I'm trying to send multiple files via socket but I'm having a problem, my program only send 1 file (or maybe my server only receive 1 file).

My code is:
Code:

var
  Size : Int64;
  i : integer;
begin
  for i :=  0 to  lbFiles.Items.Count -1 do
  begin
        ArqTmp.Clear;
        ArqTmp.LoadFromFile(lbFiles.Items.Strings[i]);
        Size := ArqTmp.Size;
        ClientSocket1.Socket.SendBuf(Size,SizeOf(Int64));
        ClientSocket1.Socket.SendBuf(ArqTmp.Memory^,ArqTmp.Size);
 end;
end;


ListBox Item 1 = C:\abc.txt for example

Thanks
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25823
Location: The netherlands

PostPosted: Sat Jul 12, 2014 2:30 pm    Post subject: Reply with quote

print out the filenames to make sure it's sending them. (perhaps lbFiles is only 1 filename)

Anyhow, i never touched those socket classes, but check the results.
socket send doesn't always send everything, so check what it did sent and then send the rest until you've finally transferred everything (could be the resending is already done in the class for you, but you'll have to check the sourcecode for that)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
cleiton
Newbie cheater
Reputation: 0

Joined: 05 Mar 2014
Posts: 21

PostPosted: Sat Jul 12, 2014 2:36 pm    Post subject: Reply with quote

Dark Byte wrote:
print out the filenames to make sure it's sending them. (perhaps lbFiles is only 1 filename)

Anyhow, i never touched those socket classes, but check the results.
socket send doesn't always send everything, so check what it did sent and then send the rest until you've finally transferred everything (could be the resending is already done in the class for you, but you'll have to check the sourcecode for that)


It's my first time programming in sockets.
Do you know any other method to send files over the internet?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites