data byte strings for transmissionbut is generally limited in scope to objects that map to types in the programming language the pickle module supports transmission of larger objectsuch as dictionaries and class instances for other tasksincluding most standard internet protocolssimpler formatted byte strings suffice we'll learn more about pickle later in this and book beyond basic data communication tasksthe socket module also includes variety of more advanced tools for instanceit has calls for the following and moreconverting bytes to standard network ordering (ntohlhtonlquerying machine name and address (gethostnamegethostbynamewrapping socket objects in file object interface (sockobj makefilemaking socket calls nonblocking (sockobj setblockingsetting socket timeouts (sockobj settimeoutprovided your python was compiled with secure sockets layer (sslsupportthe ssl standard library module also supports encrypted transfers with its ssl wrap_socket call this call wraps socket object in ssl logicwhich is used in turn by other standard library modules to support the https secure website protocol (http client and urllib request)secure email transfers (poplib and smtplib)and more we'll meet some of these other modules later in this part of the bookbut we won' study all of the socket module' advanced features in this textsee the python library manual for usage details omitted here socket basics although we won' get into advanced socket use in this basic socket transfers are remarkably easy to code in python to create connection between machinespython programs import the socket modulecreate socket objectand call the object' methods to establish connections and send and receive data sockets are inherently bidirectional in natureand socket object methods map directly to socket calls in the library for examplethe script in example - implements program that simply listens for connection on socket and echoes back over socket whatever it receives through that socketadding echo=string prefixes example - pp \internet\sockets\echo-server py ""server sideopen tcp/ip socket on portlisten for message from clientand send an echo replythis is simple one-shot listen/reply conversation per clientbut it goes into an infinite loop to listen for more clients as long as this server script runsthe client may run on remote machineor on same computer if it uses 'localhostfor server "" network scripting