Re: [twsocket] THttpCli and UPnP devices

2006-04-03 Thread Wilfried Mestdagh
Hello Kris,

 Basically, I cannot connect to port xxx for sending when I'm already
 listening to it...

A socket can send and receive both. UDP Connect is the same as UDP
Listen. So you can not do both. The difference is the handling.

If you call connect then send, then you send to the addr:port in the
properties. LocalAddr:LocalPort are the interface the socket is bound.

If you call listen then you bind to the Addr:Port properties. If you
call Listen you have to send with SendTo.

---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz

Sunday, April 2, 2006, 22:28, Kris Schoofs wrote:

 But that's not a problem is it?  Listen, connect, send query, wait x
 seconds for responses, stop listen, repeat... 

 I'm unable to execute the sequence you suggest.

 Listen to port xxx  : OK
 Connect to port xxx : 'winsock.bind failed, error #10048'
 So, I'm unable to send the query and that's where it ends... Nobody will
 respond.

 Basically, I cannot connect to port xxx for sending when I'm already
 listening to it...

 And my guess is that with the sequence I'm currenlty using...
 - Connect to port  : Send query
 - Close port 
 - Listen to port 
 ...There is too much delay between switching from sending to listening
 causing me to miss some of the initial UDP packets.

 When running tests I can see 3 scenarios

 Either :
 (A) I get no packets at all. 
= Ethereal shows for every response that was sent to me an ICMP that
 reports destination unreachable (Port unreachable). Apparently the socket
 is not yet listening...

 Or

 (B) I only get some of the packets. Usually the first few of the sequence
 are missing (the UPnP device I'm currently using sends back 14 packets in
 response to my discovery request). Strangely enough, Ethereal does not
 report anymore that the destination unreachable (Port unreachable), but
 TWSocket also does not make those initial packets available to me.

 Or

 (C) Sometimes everything works great and I get all packets sent to me (14 in
 my test case, as confirmed by Ethereal).

 I'm also wondering why sometimes OnDataAvailable is called when listening
 but Receive() reports that the received length is -1.

 SCENARIO A
 - I get nothing back
 - Ethereal shows for every response that was sent to me an ICMP that reports
 destination unreachable (Port unreachable).
 ==
 Send UDP : Send via port 1171
 Send UDP : DONE. Close Socket
 LISTEN UDP : listening on port 1171
 Listen UDP for 5 seconds : DONE. Close Socket
   UDP with ReceiveLength 0 = [00]
   UDP with ReceiveLength 1 = [00]


 SCENARIO B 
 - only 11 out of 14 packets
 - First 3 packets are missing, see scenario B
 ==
 Send UDP : Send via port 1167
 Send UDP : DONE. Close Socket
 LISTEN UDP : listening on port 1167
 UDP#01=ReceiveLen=249
 UDP#02=ReceiveLen=283
 UDP#03=ReceiveLen=249
 UDP#04=ReceiveLen=283
 UDP#05=ReceiveLen=261
 UDP#06=ReceiveLen=309
 UDP#07=ReceiveLen=296
 UDP#08=ReceiveLen=313
 UDP#09=ReceiveLen=315
 UDP#10=ReceiveLen=305
 UDP#11=ReceiveLen=305
UDP#**=ReceiveLen=-1
UDP#**=ReceiveLen=-1
UDP#**=ReceiveLen=-1
UDP#**=ReceiveLen=-1
UDP#**=ReceiveLen=-1
UDP#**=ReceiveLen=-1
UDP#**=ReceiveLen=-1
UDP#**=ReceiveLen=-1
UDP#**=ReceiveLen=-1
UDP#**=ReceiveLen=-1
 Listen UDP for 5 seconds : DONE. Close Socket
   UDP with ReceiveLength 0 = [11]
   UDP with ReceiveLength 1 = [10]


 SCENARIO C 
 - I get everything back nicely
 ==Send UDP : Send via port 1166
 Send UDP : DONE. Close Socket
 LISTEN UDP : listening on port 1166
 UDP#01=ReceiveLen=232
 UDP#02=ReceiveLen=243
 UDP#03=ReceiveLen=304
 UDP#04=ReceiveLen=249
 UDP#05=ReceiveLen=283
 UDP#06=ReceiveLen=249
 UDP#07=ReceiveLen=283
 UDP#08=ReceiveLen=261
 UDP#09=ReceiveLen=309
 UDP#10=ReceiveLen=296
 UDP#11=ReceiveLen=313
 UDP#12=ReceiveLen=315
 UDP#13=ReceiveLen=305
 UDP#14=ReceiveLen=305
 Listen UDP for 5 seconds : DONE. Close Socket
   UDP with ReceiveLength 0 = [14]
   UDP with ReceiveLength 1 = [00]

 Kris

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On
 Behalf Of Angus Robertson - Magenta Systems Ltd
 Sent: zondag 2 april 2006 18:56
 To: twsocket@elists.org
 Subject: Re: [twsocket] THttpCli and UPnP devices

 However, any subsequent attempts to use that same port for sending the
 UDP packet fail. Only after closing the socket used for listening I 
 can use that port for sending a packet.

 But that's not a problem is it?  Listen, connect, send query, wait x seconds
 for responses, stop listen, repeat...

 Does Windows not provide an API for UPnP discovery?  Certainly Windows
 Vista, which I'm currently playing with, has Function Discovery interfaces
 that do all this, Vista even found my Linksys wireless access point, mind it
 didn't find a proper display adapter and Vista is really painful in VGA.

 Angus
 --
 To unsubscribe or change your settings for TWSocket mailing list please goto
 

[twsocket] HTTPCli in dynamically-loaded BPL

2006-04-03 Thread Mike Scott
I'm wondering how to get an HttpCli to work in a dynamically-loaded BPL. 
I have made a BPL with forms that open  close OK when called 
dynamically from a test app, but when I tried to use HtppCli  I got a 
crash on closing the test app; if I put  the  HttpThr1 demo in, it 
crashes as soon as I click  the Do It button..

-- 
Mike Scott

***
If you publish research which uses WordSmith, do let me know so I can include 
it at
http://www.lexically.net/wordsmith/corpus_linguistics_links/papers_using_wordsmith.htm
***
School of English
University of Liverpool
Liverpool L69 3BX, UK.
www.lexically.net
www.liv.ac.uk/~ms2928

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


Re: [twsocket] Any BCB users out there?

2006-04-03 Thread Fredrik Bergström
I'm also running BCB6 and BCB2006.

For BCB6 I run a quite old v5 and for BCB2006 the latest beta.

I did have some small problems with installing on BCB2006, but I got
the project file to work after some fiddling about. And now it works
great.

Do not remember how I got it to work, I think I used the project file
from the Partner CD, but not completely sure.

I really like BCB2006, it is like a vacation after working all day
with a large project in BCB6 ;).

/Fredrik

On Tue, 7 Mar 2006 18:36:17 +0200 GMT, Fastream wrote:

 Hello,

 As far as I can remember, we are not the only BCB users here on this list.
 Could you confirm that you are as well using BCB and how do you install and
 use the latest versions on your C++ compiler?

 Best Regards,

 SubZ 


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


Re: [twsocket] Any BCB users out there?

2006-04-03 Thread Fastream Technologies
v6 promises a lot for everybody but currently BCB users cannot use it.

SZ

- Original Message - 
From: Fredrik Bergström [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Monday, April 03, 2006 6:19 PM
Subject: Re: [twsocket] Any BCB users out there?


 Sorry, should have been:

 For BCB6 I run a quite old v5 and for BCB2006 the latest v5 beta.

 /Fredrik

 On Mon, 3 Apr 2006 17:17:34 +0200 GMT, Fredrik wrote:

 I'm also running BCB6 and BCB2006.

 For BCB6 I run a quite old v5 and for BCB2006 the latest beta.

 I did have some small problems with installing on BCB2006, but I got
 the project file to work after some fiddling about. And now it works
 great.

 Do not remember how I got it to work, I think I used the project file
 from the Partner CD, but not completely sure.

 I really like BCB2006, it is like a vacation after working all day
 with a large project in BCB6 ;).

 /Fredrik

 On Tue, 7 Mar 2006 18:36:17 +0200 GMT, Fastream wrote:

 Hello,

 As far as I can remember, we are not the only BCB users here on this 
 list.
 Could you confirm that you are as well using BCB and how do you install 
 and
 use the latest versions on your C++ compiler?

 Best Regards,

 SubZ



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

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


[twsocket] Number of characters in HtmlSmtpClient.HtmlText property

2006-04-03 Thread WP
Hi
I wrote program, that sending emails in Html format. Everything works great, 
but I found big problem.
I use THtmlSmtpCli component. 
There is HtmlText property, which is TStrings type.
I have got:
  HtmlSmtpClient.HtmlText:= EmailBody;

  HtmlSmtpClient.EmailImages.Clear;
  HtmlSmtpClient.EmailImages.Add(FirstImage);
  HtmlSmtpClient.EmailImages.Add(SecondImage);
  HtmlSmtpClient.Host:= SmtpServerName;
  HtmlSmtpClient.Port:= IntToStr(SmtpServerPort);
  HtmlSmtpClient.FromName:=UserName + ' '+UserEmail+'';
  HtmlSmtpClient.HdrSubject:=Topic;
...


EmailBody is a TStringList variable, that store Html mail text...
One of this EmailBody lines is very long, about 900 characters... 
The problem is that when I receive that email the text is truncuted, after 
about 850 characters in that long line.
So, does HtmlText property cutting long lines to specified line length? Or, am 
I dong something wrong?

Thanks in advance, regards!
Paweł
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be