[twsocket] UDP broadcast error Permission denied

2010-12-23 Thread Arno Garrels
Hi,

When I try a SendTo() address 255.255.255.255 with an UDP listening 
TWSocket I get error WSAEACCES Permission denied, is this normal?.
SendTo() 192.168.1.255 works, Firewall is turned off.

procedure TMyServer.UdpListen;
begin
  if FUDP = nil then
FUDP := TWSocket.Create(nil);
  FUDP.Proto := 'udp';
  FUDP.Addr  := '0.0.0.0'; // listening on one interface doesn't 
change it.
  FUDP.Port  := '30003';
  FUDP.OnDataAvailable   := UdpDataAvailable;
  FUDP.ReuseAddr := TRUE;
  FUDP.Listen;
end;

procedure TMyServer.SendHelo;
var
  Dst: TSockAddrIn;
  DstLen : Integer;
  Buf: AnsiString;
begin
  FillChar(Dst, SizeOf(Dst), 0);
  Dst.sin_family  := AF_INET;
  Dst.sin_port:= WSocket_htons(StrToIntDef(FPort, 30003));
  Dst.sin_addr.S_addr := u_long(INADDR_BROADCAST);
  Buf := 'Helo';
  if FUDP.SendTo(Dst, DstLen, PAnsiChar(Buf), Length(Buf) + 1) = -1 then
raise Exception.Create(WSocketErrorDesc(WSocket_WSAGetLastError));
end;

-- 
Arno Garrels
--
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


Re: [twsocket] UDP broadcast error Permission denied

2010-12-23 Thread Francois PIETTE

To broadcast on 255.25.255.255, use connect() and then send().
Connect() will set SO_BROADCAST option at the socket level.

--
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: Arno Garrels arno.garr...@gmx.de

To: twsocket@elists.org
Sent: Thursday, December 23, 2010 12:20 PM
Subject: [twsocket] UDP broadcast error Permission denied



Hi,

When I try a SendTo() address 255.255.255.255 with an UDP listening
TWSocket I get error WSAEACCES Permission denied, is this normal?.
SendTo() 192.168.1.255 works, Firewall is turned off.

procedure TMyServer.UdpListen;
begin
 if FUDP = nil then
   FUDP := TWSocket.Create(nil);
 FUDP.Proto := 'udp';
 FUDP.Addr  := '0.0.0.0'; // listening on one interface 
doesn't change it.

 FUDP.Port  := '30003';
 FUDP.OnDataAvailable   := UdpDataAvailable;
 FUDP.ReuseAddr := TRUE;
 FUDP.Listen;
end;

procedure TMyServer.SendHelo;
var
 Dst: TSockAddrIn;
 DstLen : Integer;
 Buf: AnsiString;
begin
 FillChar(Dst, SizeOf(Dst), 0);
 Dst.sin_family  := AF_INET;
 Dst.sin_port:= WSocket_htons(StrToIntDef(FPort, 30003));
 Dst.sin_addr.S_addr := u_long(INADDR_BROADCAST);
 Buf := 'Helo';
 if FUDP.SendTo(Dst, DstLen, PAnsiChar(Buf), Length(Buf) + 1) = -1 then
   raise Exception.Create(WSocketErrorDesc(WSocket_WSAGetLastError));
end;

--
Arno Garrels
--
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 


--
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


Re: [twsocket] UDP broadcast error Permission denied

2010-12-23 Thread Arno Garrels
Francois PIETTE wrote:
 To broadcast on 255.25.255.255, use connect() and then send().
 Connect() will set SO_BROADCAST option at the socket level.

Thanks, I have to use the listening socket in order to avoid 
Bind errors, setting SO_BROADCAST after Listen actually works fine.

Happy Holidays

-- 
Arno Garrels

 
 --
 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: Arno Garrels arno.garr...@gmx.de
 To: twsocket@elists.org
 Sent: Thursday, December 23, 2010 12:20 PM
 Subject: [twsocket] UDP broadcast error Permission denied
 
 
 Hi,
 
 When I try a SendTo() address 255.255.255.255 with an UDP listening
 TWSocket I get error WSAEACCES Permission denied, is this normal?.
 SendTo() 192.168.1.255 works, Firewall is turned off.
 
 procedure TMyServer.UdpListen;
 begin
  if FUDP = nil then
FUDP := TWSocket.Create(nil);
  FUDP.Proto := 'udp';
  FUDP.Addr  := '0.0.0.0'; // listening on one interface
 doesn't change it.
  FUDP.Port  := '30003';
  FUDP.OnDataAvailable   := UdpDataAvailable;
  FUDP.ReuseAddr := TRUE;
  FUDP.Listen;
 end;
 
 procedure TMyServer.SendHelo;
 var
  Dst: TSockAddrIn;
  DstLen : Integer;
  Buf: AnsiString;
 begin
  FillChar(Dst, SizeOf(Dst), 0);
  Dst.sin_family  := AF_INET;
  Dst.sin_port:= WSocket_htons(StrToIntDef(FPort, 30003));
  Dst.sin_addr.S_addr := u_long(INADDR_BROADCAST);
  Buf := 'Helo';
  if FUDP.SendTo(Dst, DstLen, PAnsiChar(Buf), Length(Buf) + 1) = -1
then raise
 Exception.Create(WSocketErrorDesc(WSocket_WSAGetLastError)); end;
 
 --
 Arno Garrels
 --
 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
--
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


Re: [twsocket] HttpCli / Async in thread problems

2010-12-23 Thread Frans van Daalen
Forgot to say that the logged status after the call  is almost always 
HttpDnsLookup


and that the exact line in HttpRequestDone is

  If (Sender as ThttpCli).State in [httpReady,httpAborting,httpClosing] 
then

  Begin
 PostMessage((Sender as THttpCli).CtrlSocket.Handle, WM_QUIT, 0, 0);


- Original Message - 
From: Frans van Daalen i...@hedaal.nl

To: ICS support mailing twsocket@elists.org
Sent: Thursday, December 23, 2010 6:32 PM
Subject: [twsocket] HttpCli / Async in thread problems



I have this code

HttpClient.OnRequestDone := HttpRequestDone;
HttpClient.OnCommand := HttpClientCommand;
HttpClient.OnLocationChange := HttpClientRelocate;
httpclient.GetASync;
httpclient.CtrlSocket.MessageLoop

in HttpRequestDone i have the following code

PostMessage((Sender as THttpCli).CtrlSocket.Handle, WM_QUIT, 0, 0);

///

Sometimes when I check the status after the GetAsync with this code

if HttpClient.State  httpready
then LogEvent('Execute','After 
MakeTheCall',StateToStr(HttpClient.State),HttpClient.Url);


I find several entries in the log event, but I have trouble understanding. 
Can someone give me a hint


As far as I can find the problems begin when the call gets a 302 and in 
this case the 302 will relocate from www. to www2.xxx


Tested both in V6 and V7

Frans



--
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



--
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


[twsocket] Season's greetings

2010-12-23 Thread Francois PIETTE

Hi Everyone !

Happy Holidays and best wishes for 2011 !

Merry Christmas,
--
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



--
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


Re: [twsocket] HttpCli / Async in thread problems --- Tryng to trace

2010-12-23 Thread Frans van Daalen
Forgot to say that the logged status after the call  is almost always 
HttpDnsLookup


and that the exact line in HttpRequestDone is

  If (Sender as ThttpCli).State in [httpReady,httpAborting,httpClosing] 
then

  Begin
 PostMessage((Sender as THttpCli).CtrlSocket.Handle, WM_QUIT, 0, 0);




I have this code

HttpClient.OnRequestDone := HttpRequestDone;
HttpClient.OnCommand := HttpClientCommand;
HttpClient.OnLocationChange := HttpClientRelocate;
httpclient.GetASync;
httpclient.CtrlSocket.MessageLoop

in HttpRequestDone i have the following code

PostMessage((Sender as THttpCli).CtrlSocket.Handle, WM_QUIT, 0, 0);

///

Sometimes when I check the status after the GetAsync with this code

if HttpClient.State  httpready
then LogEvent('Execute','After 
MakeTheCall',StateToStr(HttpClient.State),HttpClient.Url);


I find several entries in the log event, but I have trouble 
understanding. Can someone give me a hint


As far as I can find the problems begin when the call gets a 302 and in 
this case the 302 will relocate from www. to www2.xxx


Tested both in V6 and V7

Frans




Found an error in OverbyeIcsHttpProt, not the reason for the error above

line 1760 :
DebugLog(loProtSpecDump, Format('PrepareNTLMAuth end, FStatusCode = %d ' +

should be

DebugLog(loProtSpecDump, Format('PrepareNTLMAuth Begin, FStatusCode = %d ' +




seems like a copy past errror.


seems that the bug is also somewhere related to the NTLM code or call 
because the icslogger shows the following


- Starting relocation process
- state = httpReady
- PrepareNTLM
- PrepareNTLM
- RequestDone psss why is that there??  It 
will trigger the onRequestDone but at the same time the relocation is still 
going on because this is the rest of the ics log while I also get the trace 
from my own software due to the trigger.


- Login www2.xxx
- State = httpDnsLookup



--
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


Re: [twsocket] Season's greetings

2010-12-23 Thread DZ-Jay
¡Feliz Navidad y un próspero Año Nuevo a todos!

(Merry Christmas and a prosperous New Year to everyone!)

dZ.


On Dec 23, 2010, at 17:40, Maurizio Lotauro wrote:

 Scrive Francois PIETTE francois.pie...@skynet.be:
 
 Hi Everyone !
 
 Happy Holidays and best wishes for 2011 !
 
 You too, and to other readers of this mailing list!
 
 
 Bye, Maurizio.
 
 
 
 
 This mail has been sent using Alpikom webmail system
 http://www.alpikom.it
 
 --
 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

--
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


Re: [twsocket] Season's greetings

2010-12-23 Thread Hoby Smith
 Francois said:
 Merry Christmas

Merry Christmas and Happy New Year to everyone from Denver, Colorado! :)

Hoby

--
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


Re: [twsocket] Season's greetings

2010-12-23 Thread Zvone
Merry Christmas and Happy 2011 from Croatia to all of you guys
especially Francois, Arno and Angus... and big thanks for all the help
and tips provided so far! You have no idea how much it is appreciated!
--
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