Re: [twsocket] THttpCli and UPnP devices

2006-04-02 Thread Kris Schoofs
Thanks Angus. Suggesting to use UDP made it suddenly a lot more comprehensible... I've played around with it and I've noticed that all UPnP devices on the network repond with an unicast message sent to my IP on the same port that I previously had used to multicast the UDP containing the discovery

Re: [twsocket] THttpCli and UPnP devices

2006-04-02 Thread Angus Robertson - Magenta Systems Ltd
> Is it OK to close the socket after sending and then immediately open > it again for listening on that same port ? You may get fast UDP responses, so I'd have thought it best to have a listening port open before sending your request, but I've not tried sending on a port already open for listeni

Re: [twsocket] THttpCli and UPnP devices

2006-04-02 Thread Kris Schoofs
I need to WSocket->Connect(); first because I need to know which port will be used for sending since this port will be the one where I'll be receiving the response. However, apparently you cannot combine a WSocket->Connect() and WSocket->Listen() without doing a WSocket->Close() inbetween since th

Re: [twsocket] THttpCli and UPnP devices

2006-04-02 Thread Angus Robertson - Magenta Systems Ltd
> I need to WSocket->Connect(); first because I need to know which port > will be used for sending Can you not use the LocalPort property to specify a fixed port? Angus -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsoc

Re: [twsocket] THttpCli and UPnP devices

2006-04-02 Thread Kris Schoofs
I just tried your suggestion I used LocalPort-property to set a fixed port to open a socket for listening first. 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.

Re: [twsocket] THttpCli and UPnP devices

2006-04-02 Thread Angus Robertson - Magenta Systems Ltd
> 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, repea

Re: [twsocket] THttpCli and UPnP devices

2006-04-02 Thread Arno Garrels
Angus Robertson - Magenta Systems Ltd wrote: >> 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,

Re: [twsocket] THttpCli and UPnP devices

2006-04-02 Thread Kris Schoofs
> 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 wher

Re: [twsocket] THttpCli and UPnP devices

2006-04-02 Thread Dan
Dont use connect, just use listen, but use SendTo to send the packet. This lets you specify the address. Dan - Original Message - From: "Kris Schoofs" <[EMAIL PROTECTED]> To: "'ICS support mailing'" Sent: Sunday, April 02, 2006 10:46 AM Subject: Re: [twsocket] THttpCli and UPnP device

Re: [twsocket] THttpCli and UPnP devices

2006-04-02 Thread Angus Robertson - Magenta Systems Ltd
> Dont use connect, just use listen, but use SendTo to send the packet. > This lets you specify the address. That would make sense, with UDP connect only opens the socket, and listen probably does the same thing. I've only only used UDP for syslog, which is one-way. Angus -- To unsubscrib

Re: [twsocket] THttpCli and UPnP devices

2006-04-02 Thread Angus Robertson - Magenta Systems Ltd
> BTW: Don't you risk a lot if you enable UpnP devices? I was told it > might be a security hole, so I disabled them where I could in my LAN. Make sure such appliances have got strong admin passwords? Discovering the devices was always possible with echo, UPnP just tells you a little more than

Re: [twsocket] THttpCli and UPnP devices

2006-04-02 Thread Wilfried Mestdagh
Hello Kris, > now and then the WSocket->>>OnDataAvailable does not get triggered This is because UDP is not reliable. If packet is received between the time you close the socket and set it to listen, then it is trow away. But wy ? Just connect, send, and that's all. If someone sends back the On