Hi !

  wsocketMain.Addr := '172.16.16.133';

delete this one unless you want to listen only to this interface. Use 0.0.0.0 (the default) to listen on all interfaces.

procedure TfrmMain.wsocketMainSessionAvailable(Sender: TObject; ErrCode:

No session with UDP, it is a connectionless protocol.
Use OnDataAvailable event and call ReceiveFrom to get data.

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be


----- Original Message ----- From: "Signed Source® Project" <dan...@signedsource.com>
To: "ICS Components" <twsocket@elists.org>
Sent: Thursday, December 02, 2010 1:08 PM
Subject: [twsocket] TWSocket UDP capturing


Hi guys,
I am trying to capture UDP packages from a device placed in my network with TWSocket.
I am unfortunately lost because I don't know how to do it.
I will be very pleased if there are any samples, if not I can put this one on the site after I made it working because it will basically look like a demo.

Here is my code,
Could you please check and give me some ideas about what is missing and what I need to do?
.................................................................................................................................................................
[procedure TfrmMain.btnClearClick(Sender: TObject);
begin
  memoPackets.Clear;
end;

procedure TfrmMain.btnCloseClick(Sender: TObject);
begin
  Close;
  Forms.Application.Terminate;
end;
 {Here I am trying to set parameters and put the socket to listen}
procedure TfrmMain.btnStartClick(Sender: TObject);
begin
  wsocketMain.Proto := 'udp';
  wsocketMain.Port := '49494';
  wsocketMain.Addr := '172.16.16.133';
  wsocketMain.Listen;
end;

{Here I am trying to close the socket}
procedure TfrmMain.btnStopClick(Sender: TObject);
begin
  wsocketMain.Close;
end;

{Here I am trying to add captured data to the memo}
procedure TfrmMain.wsocketMainSessionAvailable(Sender: TObject; ErrCode: Word);
begin
  memoPackets.Lines.Add(wsocketMain.ReceiveStr) //??
end;

end.]

--
-daniel

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to