Browser and exe

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Browser and exe

Marcos Douglas B. Santos
On Thu, May 25, 2017 at 10:58 AM, Sven Barth via fpc-pascal
<[hidden email]> wrote:
>> But I meant, how do you know if another app is already using a port
>> that you want to use?
>
> You'll get an error by the OS if someone is already listening on the
> port that you want to listen on yourself.

In other words, use a try-except. If error, retry using another port.

Thanks Sven.

Best regads,
Marcos Douglas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Browser and exe

Graeme Geldenhuys-6
On 2017-05-25 15:04, Marcos Douglas B. Santos wrote:
> In other words, use a try-except. If error, retry using another port.

Yup.

Regards,
   Graeme

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Browser and exe

noreply
In reply to this post by Marcos Douglas B. Santos
On 2017-05-25 08:14, Marcos Douglas B. Santos wrote:

> On Wed, May 24, 2017 at 4:23 PM, Graeme Geldenhuys
> <[hidden email]> wrote:
>>> 2. How did you garantee that others applications aren't being using
>>> the same port as your application to avoind conflicts?
>>
>>
>> I looked at the official IANA list of registered port numbers and
>> chose a
>> port number that hasn't been taken yet.
>>
>>    http://www.iana.org/assignments/port-numbers
>>
>> Under FreeBSD you can review the /etc/services file. I believe Linux
>> has
>> something similar. Or simply use the URL above.
>
> Thanks for that link, I didn't know.
> But I meant, how do you know if another app is already using a port
> that you want to use?

This is the reason I think web servers are the wrong way to go for any
desktop application (Golang is going crazy with everything being an http
server). Because ensuring ports are open is a pain in the butt, plus all
the firewall issues.
Chromium embedded/firefox embedded needs no ports open, But maybe it's
not your need
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Browser and exe

Marcos Douglas B. Santos
On Fri, May 26, 2017 at 1:27 AM,  <[hidden email]> wrote:

>> But I meant, how do you know if another app is already using a port
>> that you want to use?
>
>
> This is the reason I think web servers are the wrong way to go for any
> desktop application (Golang is going crazy with everything being an http
> server). Because ensuring ports are open is a pain in the butt, plus all the
> firewall issues.
> Chromium embedded/firefox embedded needs no ports open, But maybe it's not
> your need

I agree with you, there is some complexity on that design but looks
like the best option to make a Web app interact with a Desktop app
without dependencies like ActiveX or Extensions for each browser,
don't you think?

Best regards,
Marcos Douglas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
12