socket.socket, network programming

socket.socket, network programming

Postby lewashby » Sun Jan 19, 2014 1:40 am

Looking over the python documentation I found the following explanation for the socket.bind function.

socket.bind(address)
Bind the socket to address. The socket must not already be bound. (The format of address depends on the address family — see above.)

There's isn't much to go on here. What does address consist of? Is it a number, a string, a tuple, or a list, or something else?

Looking over the code in my python book I'm having a hard time learning this stuff. I think rather than trying to remember all the functions and argument I would do better to simply learn the steps needed to build a server and accompanying client. Such as, choose unused port, create socket object, open a listening connection, etc... Could someone please give me a hand on learning the logical step for creating a server and client program in python? And also give me a hand with my documentation research problems.
lewashby
 
Posts: 2
Joined: Wed Jan 15, 2014 9:32 pm

Re: socket.socket, network programming

Postby stranac » Sun Jan 19, 2014 1:47 am

There are some examples in the docs: http://docs.python.org/2/library/socket.html#example

I would suggest using twisted for network programming rather than messing with raw sockets.
This introduction is pretty good: http://krondo.com/?page_id=1327
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1114
Joined: Thu Feb 07, 2013 3:42 pm


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest