Autor Beitrag
Luncustaf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324

Win 2k
D7 Ent.
BeitragVerfasst: Di 18.06.02 10:45 
Also ich hab mich zu einem Server über oben genannte Komponente connected und ich möchte nur das was nach einem bestimmten Socket.SendText(blah) als rückantwort geliefert wird in einem memofeld haben. das problem ist halt ich kann die verbindung zwischendrin nicht trennen also muss alles über diesen einen Socket laufen und in Socket.ReceiveText ist leider alles seit beginn der verbindung enthalten. Ich habe auch nichts gefunden um diesen TString auf null zu setzen :/

Wäre sehr erfreut über baldige Hilfe.

gr€€tz Luncustaf
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Di 18.06.02 10:56 
Hallo,

ich kenne zwar weder die Komponente noch das genaue Prizip aber:

Zitat:
ich möchte nur das was nach einem bestimmten Socket.SendText(blah) als rückantwort geliefert wird


kannst du dir nicht einfach den Füllstand von Socket.ReceiveText merken wenn du SendText(blah) aufrufst? Dann must du später eben alles ab diesem Füllstand auswerten.

Gruß
Klabautermann
Luncustaf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324

Win 2k
D7 Ent.
BeitragVerfasst: Di 18.06.02 13:08 
hi,

thx for answer :)

hab ich auch schon probiert aber das geht nicht ich brauche eine bestimmte zeile :) naja ich muss es anners probieren ich kann aber das socker.receivetext auch nicht auf null setzen also Socket.ReceiveText := '';

das geht leider net :(

gr€€tz Luncustaf
crip
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Mo 24.06.02 16:13 
Also soweit wie ich es verstehe willst den angekommenen Text in Memo zufuegen (etwa Chat prinzip). was heisst bitte schoen receivetext auf "" setzen!!! wofuer denn das!! also wenn ich es doch riichtig gerafft habe heisst das ganze wohl das was von dem Clientsocket geschickt wird mit Serversocket empfangen und in Memo einfuegen

wie man etwas verschickt weiss du ja jetzt gehst du beim serversocket bei dem event "ONClientRead" und schreibst das damit es so aussieht
ausblenden Quelltext
1:
2:
3:
4:
5:
procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
  Socket: TCustomWinSocket);
begin
 memo1.Lines.Add(socket.receivetext);
end;

dann wird der gesendete Text in Memo eingefuegt ;
wenn ich das richtig verstanden hab, was glaub ich nit der fall is :lol:

Mfg

Crip :arrow: Was ist zur Hoelle "Real Life" und wo kann ich es runterladen :wink:
Luncustaf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324

Win 2k
D7 Ent.
BeitragVerfasst: Di 25.06.02 08:50 
hi,


öhm :) also ich will halt das ganze was ankommt erst ab einer bestimmten stelle in das memofeld schreiben. aber kann ich das dann so machen ?
ausblenden Quelltext
1:
2:
3:
4:
if (socketsendtext = true)
then begin
memo.line.add(......);
end;


usw verstehst du geht das ?

gr€€tz Luncustaf
crip
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Di 25.06.02 20:38 
Ab welche stelle denn?
du kannst auch machen in der selber prozedure
ausblenden Quelltext
1:
2:
3:
  If socket.receivetext = 'deine bestimmte stelle oda so :-) ' then
  memo1.lines.add(memory + socket.receivetext)
 else memomory  := memory + socket.receivetext



also um diesen teil dann ausbauen, waere ne moeglichkeit;
beschreib ma dein Prog, oda gib mal nen Beispiel an!!

Crip :D
opfer.der.genauigkeit
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754
Erhaltene Danke: 1



BeitragVerfasst: Mi 01.09.04 22:15 
Hat die Komponente ein OnRead- Event?

Wenn ja, dann das hier mal anschauen:
Hab ich aus der Hilfe für TClientSocket kopiert.

Zitat:

Delphi syntax:

property OnRead: TSocketNotifyEvent;

Description

Write an OnRead event handler to read from the socket connection. If the socket is a blocking socket, use a TWinSocketStream object to read from the connection. Otherwise, use the methods of the Socket parameter to perform the actual reading.

Note: Non-blocking sockets do not always receive an OnRead event for the last bit of data passed over the connection. When using a non-blocking socket, check for any unread data in the OnDisconnect event to make sure that everything is handled.


Vielleicht hilfts.

_________________
Stellen Sie sich bitte Zirkusmusik vor.