If you want to start at a high level, I recommend reading about Twisted or one of its alternatives.
Could you give an example of what you are trying to achieve? Do you want a web server? A web crawler? A custom client-server protocol? All have different solutions, there is no catch-all way to do 'networking' in Python. Starting out with sockets might be great for a high-performance application where you need to access the fundamentals of networking, but for anything more abstract (so basically, anything.) you're better off using an existing library.
Bottle and flask both work in py3 now, twisted works in py3, requests works, beautifulsoup works, SQLAlchemy works, pyqt works, PIL works thanks to pillow taking up where they left off, basically everything you need.
All/most of these work without 2to3 hacks either, they are coded as native works-in-both code.
edit: Apparently only a subset of twisted, list of modules here http://twistedmatrix.com/trac/browser/tags/releases/twisted-15.1.0/twisted/python/dist3.py#L33
Several Twisted libraries. Our whole infrastructure runs on top of Twisted, it highly integrated with it, and some of the twisted.web and twisted.cred libraries are still not available on Python 3. See http://twistedmatrix.com/trac/wiki/Plan/Python3 for the list; most things are crossed out, but there are a still a few that would be blockers for us.
The other, which will never be ported, is PyGTK. It has been superseded by PyGObject for GTK+3, but that means that we also need to do a port to PyGObject/GTK+3 at the same time as (or before) a Python 3 port.
There may be other minor libraries that haven't been ported, I haven't done a full audit of our dependencies.
Once we do have all of the dependent libraries, we have a large code base with very poor unit test support that we would need to port to Python 3 and then fix all of the inevitable bugs in string handling that process introduces. Yes, we should have better unit test coverage, and I've made sure that all of the new code that I've written has pretty good test coverage, but there's still a large amount of legacy code, from before I joined, without it. So that means that there will be inevitable issues.
Overall, it would be a good amount of pain to switch over, for not much benefit. We will do it eventually, but we have just finished a project changing out our base Linux distro, that also required an awful lot of fixing up of hidden assumptions but provided not much customer-visible benefit, so it will be a little while before we are able to do another big project that doesn't provide much in the way of tangible results.
Scrapy seems to be the same, which makes this make more sense since it uses scrapy. Scrapy being 2.7 probably reflects that it is built on top of Twisted, which as far as I know isn't yet done moving to python 3.
I'm guessing that's because people seldom offer to actually fix the docs or they read the docs and decide to move on because they feel exactly like /u/Proselyte5 does. Twisted is not as 'pretty' as newer libraries out there and most people's projects are not complex enough to really require something like Twisted instead of implementing a solution another way.
Twisted is definitely not experimental, it's used fairly heavily by several major companies and projects:
https://twistedmatrix.com/trac/wiki/SuccessStories http://twistedmatrix.com/trac/wiki/ProjectsUsingTwisted
I notice in that list that the networking stuff refers to sockets only. While this is unquestionably the place to start, the programmer will soon need to use some kind of event loop if trying to make anything like a network game, chat application, or networked program integrated with a GUI loop.
For this type of program in python there is nothing better than Twisted, and for learning Twisted there is nothing better than this tutorial. It is in fact the best tutorial on any aspect of programming I've ever read.
Perhaps you're using a reactor where restarting has been implemented, but the stock reactors don't support restarting. If you are using the vanilla reactor, you're probably not calling the stop
method between instances, or you're using processes like in my tests.
As long as you're doing stuff with established protocols (HTTP, JSON, etc) you really shouldn't be restricted to a single platform. As for authentication, when you're looking at server frameworks check for an authentication plugin. For example Twisted(like nodejs, but python) has a plugin for authentication. You might have to write some code client side to connect properly, but it shouldn't be that big of a deal.
I suspect the modules used in twisted.internet.ssl hasn't been fully ported over to Python 3.x yet. It's kinda strange given that it's labeled as fixed in Twisted's issue tracker (http://twistedmatrix.com/trac/ticket/6142).
Or given that you're using Windows and historically Twisted's Windows support hasn't been their top priority, may also be the culprit. No one really has Windows test machines at Twisted and they're always looking for people to help out in that regard. Head on over to their Trac page (http://twistedmatrix.com/trac/report) and file a bug. Search first to see if it's not already a similar bug. Twisted is community driven so any sort of contribution, even reporting bugs, helps.
In any case, Twisted works best with Python 2.7.x so you may want to get that version
Twisted is trying to set up a _SocketWaker which is a utility class that allows other threads to wake up the IO thread by sending a signal over a socket. Your computer is trying to connect to itself. This is intended behaviour and part of the way twisted works. To fix the problem you need to work out why your computer might be refusing this connection. Perhaps you have a firewall?
If we are using python we should use something like http://twistedmatrix.com/trac/
There is also a great wiki article that will help with irc: http://en.wikipedia.org/wiki/List_of_Internet_Relay_Chat_commands
ironically I think we should also set up an irc channel so we can talk about this easier
Twisted is an asynchronous thing. And there are ways to make said control flow more imperative-like in Twisted, like the deferred generator feature.
With those restrictions, no, there's really no better way to do what you're doing, short of writing your own wrapper around SSH protocol (as far as i know at least, there are no real builtins in python for this kind of thing). You could just pass unencrypted JSON messages back and forth on 22 without SSH encryption, but to me that kind of defeats the purpose.
If you can get root access to install a package, however, look at Twisted and Twisted Conch (for SSH), in my experience those are the most thorough and reliable networking/SSH implementations in python you can find.
Lastly, here is a wiki page with a list of most known ssh implementations in python, for unbias reference.
In your server file, in the ClientThread class' run method, you are referencing the global variable "c" (which in this case is the most recent connected client from your while loop at the bottom) instead of "self.c" which is the client that that thread is meant to handle. Same problem in your client's UpdateChat thread class. should be "self.s" instead of just "s".
I'm quite confident this is your problem because once multiple connections are made you would easily run into a race condition where multiple threads would be trying to hit the same socket object.
As an unrelated suggestion, In the future there are libraries (like Twisted) that make asynchronous (threaded) networking easier to handle in python by managing the event loops and socket connections for you.
That looks very good. I was looking at their milestone "Python-3.x":
> Total number of tickets: 195 - closed: 142 - active: 53
This would be 72% ready.
Well...I remember hitting the same issue with Thug.py. Turned out that the Twisted Python package was too old.
Read up on how to manually install Twisted from source so you have the latest version. You might also choose to compile and install a custom version Python in your Home folder, so that when you install Twisted you can use that version and not mess up the System version.
Quick and Dirty Python Compiling for Debian https://gist.github.com/whop/2659457
Well the twisted bug is opened for more than 4 years.
More than 2 years ago, I asked about IPv6 support on the IRC channel, I've been told something like "who cares about IPv6"
Any language that has decent text processing can do this. It's really just a crapload of find+replaces; as sazzer said, they are mostly control codes. Take a look at http://pcmicro.com/netfoss/telnet.html or http://support.microsoft.com/kb/231866 to help figure it out. TwistedMatrix (python) has a lot of telnet libraries that might help you out, as well: http://twistedmatrix.com/trac/.