Autor Beitrag
XenoX
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 50



BeitragVerfasst: Sa 24.04.04 15:17 
hallo, ich habe folgendes problem: wenn ich über die delphi sockets buffer bzw streams versende ( socket.sendbuf(stream.memory^,stream.size); ), und zwar schnell hintereinander, kommen viele auf einmal an.. wi ekann ich das verhindern?
BungeeBug
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 901



BeitragVerfasst: Sa 24.04.04 15:41 
Hi,

ich versteh nicht das Problem? Die Daten werden schnell gesendet also kommen sie auch schnell an :) Das ist logisch. Oder meinst du das die Daten durcheinander ankommen?
XenoX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 50



BeitragVerfasst: Sa 24.04.04 16:24 
hey

die daten werden durcheinander gewürfelt glaube ich...

also irgendwie kommen 4 auf einmal an oder so
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Sa 24.04.04 18:38 
glaubst du es oder weisst du es?

poste doch mal etwas code.
grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
DracoBlue
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26



BeitragVerfasst: Mi 29.09.04 15:52 
ausblenden Quelltext
1:
2:
Socket.SendText("Hallo");
Socket.SendText("Hallo");


Ich habe das gleiche Problem, den dieser kommt als nicht 2 Onread-Events sondern nur als eins an.

Kann man dem nicht irgendwie sagen "verschicke jetzt!" ?

Ich hoffe Ihr könnt mir helfen,

Draco
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 02.10.04 05:45 
Eine Möglichkeit (wenn auch nicht sehr elegant) wäre, hinter jedes Datenpaket ein Nullbyte (#0) oder davor die Länge zu setzen. Mehrtraffic: 1-4 Bytes. Mehraufwand Source: 50 Zeilen.
Danach einfach diese Marken auswerten, wenn nötig puffern und Pakete auswerten ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
DracoBlue
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26



BeitragVerfasst: Di 05.10.04 08:10 
Ist ziemlich unsauber,
ich schicke nun vor jedem Text nen byte (bzw. 2..n bei mehr als 255 Zeichen) wo drin steht wie lang der text danach ist.
Dann wird das ganze mit einem stream ausgelesen und ich kann sauber damit arbeiten.

Übrigens war mein record davor schon dieses Format, der Trick mit dem stream ist mir aber erst im DP-Forum eingefallen (Link dazu)
Aber eine flush() [wie bei php] Methode wäre praktischer :-D

Mit freundlichem Gruß,
Draco
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Di 05.10.04 08:20 
Wieso ist die Angabe der Länge nicht elegant?

Cu,
Udontknow
DracoBlue
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26



BeitragVerfasst: Di 05.10.04 08:45 
er meint das mit dem #0 am Ende.

Mfg, Draco