Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi irc dcc gets/sends (https://www.delphipraxis.net/4393-irc-dcc-gets-sends.html)

sECuRE 27. Apr 2003 13:38


irc dcc gets/sends
 
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?!

Daniel B 27. Apr 2003 13:52

Hallo,

ich habe es mal nach Internet/IP/Lan verschoben.

Grüsse, Daniel :hi:

sharkx 27. Apr 2003 15:32

Hier gibt es mehrere Beispiele zu IRC Clienten. Unteranderem auch das DCC behandelt.

Torry

sECuRE 27. Apr 2003 16:20

die page kannte ich schon, die einzige open source komponente, die dcc unterstützt, hilft mir leider nicht weiter.. die behandelt mein Problem garnicht oder ich bin zu blöd um das zu finden

CrashMan 4. Jan 2004 22:05

Re: irc dcc gets/sends
 
Bist du weitergekommen?

Sitze gerade selber an einem IRC-Clienten ... beim DCC hakts... (da bleib ich stecken, das hab ich noch net) :wall:

Kannst ma eben sagen, wie ich das mache? :mrgreen:

CrashMan


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:59 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz