Thema: Delphi irc dcc gets/sends

Einzelnen Beitrag anzeigen

Benutzerbild von sECuRE
sECuRE

Registriert seit: 10. Apr 2003
Ort: Heidelberg
360 Beiträge
 
Delphi 7 Professional
 
#1

irc dcc gets/sends

  Alt 27. Apr 2003, 13:38
Hi!
ich bin grade dabei, einen irc-client zu entwickeln komme beim Thema DCC nicht mehr weiter:
momentan öffne ich eine Verbindung zum anderen Client, der mir zuvor gesagt hat, auf welchem port/ip usw.. Dann fängt der andere Client an mir die Daten zu schicken, allerdings hört er nach ca 5 oder 6 packets auf, weil er eine Bestätigung erwartet. Wenn ich jetzt nach jedem Packet eine Bestätigung mit 4 Bytes Länge schicke (wie im RFC vorgeschrieben), stürzt der Client mit einer Zugriffsverletzung ab..
mein Sourcecode sieht so aus:
Delphi-Quellcode:
procedure TForm2_1.DCCSockRead(Sender: TObject; Socket: TCustomWinSocket);
var c,ret:integer;szBuffer: array[0..8192] of Char;
begin
c:=StrToInt(GetToken(TClientSocket(Sender).Name,'_',2));
FillChar(szBuffer, SizeOf(szBuffer), 0);
ret:=Socket.ReceiveBuf(szBuffer[1], SizeOf(szBuffer));
dcc_f[c].Write(szBuffer[1], ret);
socket.SendText(dcc_f[c].Size);
end;
Auszug aus dem DCC-RFC:
Zitat:
Data is sent in packets, rather than dumped in a stream manner. This allows the DCC SEND connection to survive where an FTP connection might fail. The size of the packets is up to the client, and may be set by the user. Smaller packets result in a higher probability of survival over bad links. The recipient should acknowledge each packet by transmitting the total number of bytes received as an unsigned, 4 byte integer in network byte order. The sender should not continue to transmit until the recipient has acknowledged all data already transmitted. Additionally, the sender should not close the connection until the last byte has been acknowledged by the recipient.
Was stimmt denn daran jetzt nicht?!
  Mit Zitat antworten Zitat