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