Dit is wat ik heb van code
Code:
procedure.SplitMessage(Header: string; Msg: TStringList; Session: TMSNSession);
var
SendMsg: string;
MsgCount, SendCount, LineCount, i: integer;
begin
//get the message count
LineCount := Msg.Count;
MsgCount := 1;
SendCount := 0;
while LineCount > 35 do
begin
LineCount := LineCount-25;
Inc(MsgCount);
end;
//split and send the message
while MsgCount <> SendCount do
begin
Inc(SendCount);
SendMsg := Header + ' ' + IntToStr(SendCount) + '/' + IntToStr(MsgCount) +
#13#10 + #13#10;
for i := 0 to 34 do
begin
if Msg.Count <> 0 then
begin
SendMsg := SendMsg + Msg.Strings[0] + #13#10;
Msg.Delete(0);
end;
end;
Session.SendMessage(SendMsg);
end;
end;
Dit word opgeromen met:
SplitMessage('XFT MyFile.txt', Base64Encoded, Session)
waar Base64Encoded een TStringList is met de Base64 van het bestand.
Normaal zou ik dus:
XFT MyFile.txt 1/547
DATA HERE
DATE HERE
...
XFT MyFile.txt 2/547
DATA HERE
DATE HERE
...
moeten aanrkijgen... dit worked ook tot bij berichtje 4 of 5 (vershilled atijd) dan krijg ik een:
Project RemoteWebcam.exe raised exception Class EIdSocketError with message 'Socket Error # 10054 Connection reset by peer'.
Iemand een idea waarom hij na 4 a 5 berichtje crashed?
Bookmarks