Re: OSError: [Errno 48] Address already in use

2018-06-28 Thread Dan Stromberg
On Wed, Jun 27, 2018 at 8:49 AM, T Berger  wrote:

> Why am I getting this error? I'm not sure what additional information I
> need to supply, so please let me know.


AIUI, there are 2 possible causes.  You either have some other process
listening on the requested port, or a process that Was using it no longer
is but not enough time has passed yet for the kernel to decide that the
port can safely be reused.

The former keeps two processes from trying to get data from the same port
at the same time, which could be confusing.

The latter is a security feature.  It keeps person A from starting an imap
server on port tcp/, and having person B come along and start a fake,
password-stealing imap server on the same port shortly after person A
terminates theirs (for example). There would otherwise be a window of time
during which B's imap daemon could steal passwords intended for A's imap
daemon, because remote imap clients wouldn't know about the switcheroo.
Note that even if A come back and starts their imap daemon immediately
after a crash, the kernel doesn't know if that is a legitimate or
illegitemate imap daemon, so that is blocked for a while too.

You can check if something else is listening on that port with
http://stromberg.dnsalias.org/~strombrg/What-program-is-active-on-that-port.html
(Linux and Solaris - there will likely be similar tools for other OS's).

You can eliminate the waiting period with SO_REUSEADDR (but if you have
something else listening on that port, then don't!). Example:
http://stromberg.dnsalias.org/~strombrg/max-tcp-window.html

HTH.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: OSError: [Errno 48] Address already in use

2018-06-27 Thread Jim Lee



On 06/27/18 08:49, T Berger wrote:

Why am I getting this error? I'm not sure what additional information I need to 
supply, so please let me know.


You asked this question two weeks ago and got several answers.  Here is 
one of them:



On 06/15/18 10:17, Percival John Hackworth wrote:

On 15-Jun-2018, T Berger wrote
(in article<3fe6b3e1-f582-415b-ace1-b104f42ef...@googlegroups.com>):


I’m trying to build a webapp with flask. I installed flask, created a
webapp in IDLE, but when I tried testing it at my terminal, I got a huge
error message. This is the app:

[snip]
line 467, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 48] Address already in use
192:Webapp TamaraB$

What went wrong?


The last message in the error message "Address already in use" means that
there's a web server using the port already running on your machine. If
you're on a Mac, you already have a local web server running on your machine.
You may or may not have specifically set that up. I intentionally setup the
development version of my web site on my system for testing.

To find out what network ports are in use on your system, you can use
command-line tools to display what processes are listening to what ports. If
none of this makes sense to you, read more on Linux networking, web
programming, and system administration before you attempt to dive into
building a web application with python.

It's like you opened the hood of your car and pointed to a cap marked "710"
and are asking us "what's that?" It's actually where you pour the "OIL" when
you need to top it off.

Good luck.

--
https://mail.python.org/mailman/listinfo/python-list


Re: OSError: [Errno 48] Address already in use

2018-06-27 Thread T Berger
On Wednesday, June 27, 2018 at 11:49:18 AM UTC-4, T Berger wrote:
> Why am I getting this error? I'm not sure what additional information I need 
> to supply, so please let me know.

I'm working on a Flask webapp. I know there is another google group 
specifically for Flask. Can you please provide the url.

Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list