Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Nov : Re: TidUDPServer
| Subject: | Re: TidUDPServer |
| Posted by: | "Marion Smith" (msmi..@extremeprogrammers.com) |
| Date: | Tue, 4 Dec 2007 13:27:49 |
I found the following and it worked.
"Note: All Indy exceptions descend from EIdException. By default, Delphi 7
has at least one item in Tools > Debugger Options > Language Exceptions
related to Indy, "Indy EIDSilentException Exceptions", and, possibly "Indy
EIDSocketError Exceptions"... which do not prevent the IDE to fail when
running in the by design exception EIdSocketError "Socket Error # 10004".
The reason is that the actual exception is "EIdSocketError", not "Indy
EIDSocketError Exceptions". Add the former through the Add button, don't
forget to add IdException in the users section, and you won't be stopped by
the IDE anymore."
Found at: http://www.fredshack.com/docs/indy.html
"Marion Smith" <msmith@extremeprogrammers.com> wrote in message
news:47559a6d$1@newsgroups.borland.com...
>I am having the same problem as discribed in this thread. The solution
>appears to be to run the app outside of the IDE. This doesn't seem like a
>solution since the error is still occuring. I think Indy may have something
>to address with this. I am attaching all of my code (as it is a simple
>chat). When the window is closed in the IDE you should get a Socket Error #
>10004.
>
> unit MainForm;
>
> interface
>
> uses
> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
> Forms,
> Dialogs, StdCtrls, Sockets, ExtCtrls, IdSocketHandle, IdBaseComponent,
> IdComponent, IdUDPBase, IdUDPServer, IdGlobal;
>
> type
> TfrmMain = class(TForm)
> memMessages: TMemo;
> txtSend: TEdit;
> btnSend: TButton;
> udp: TIdUDPServer;
> procedure udpUDPRead(Sender: TObject; AData: TBytes;
> ABinding: TIdSocketHandle);
> procedure btnSendClick(Sender: TObject);
> procedure FormClose(Sender: TObject; var Action: TCloseAction);
> private
> { Private declarations }
> public
> { Public declarations }
> end;
>
> var
> frmMain: TfrmMain;
>
> implementation
>
> {$R *.dfm}
>
> procedure TfrmMain.btnSendClick(Sender: TObject);
> begin
> if txtSend.Text <> '' then udp.Broadcast(txtSend.Text, udp.DefaultPort);
> txtSend.Text := '';
> end;
>
> procedure TfrmMain.FormClose(Sender: TObject; var Action: TCloseAction);
> begin
> udp.Active := False;
> end;
>
> procedure TfrmMain.udpUDPRead(Sender: TObject; AData: TBytes;
> ABinding: TIdSocketHandle);
> var
> s: String;
> begin
> s := BytesToString(AData);
> memMessages.Lines.Add(s);
> end;
>
> end.
>
>
> "GannTrader" <Gann_Trader@hotmail.com> wrote in message
> news:472cf7cf@newsgroups.borland.com...
>> Hi
>>
>>> The only time you would ever see it is if you are running your project
>>> inside the IDE's debugger.
>>
>> OK thats why.
>> Yes i was running the project inside delphi.
>> When just running the exe-file the error didn't occur.
>>
>> Thanx