Network and socket programming in python

i want to learn network and socket programming but i would like to do this in python.Reason behind this is that python is very simple and the only language i know . 
anybody can suggest me which book should i pick.
the book should have following specification--
1)not tedious to follow
2)lots of example
3)starts with some networking stuff and then get into codes
thanks in advance with regards.

hmm. well, your requirements are almost contradictory.
Not sure about books, except maybe dusty's.
Most python books cover at least some network programming (unless the book is topic specific).
I use lots of python-twisted at work. I mean ALOT. I wouldn't recommend it to someone looking for non-tedious though! I also like gevent/eventlet (esp. the async socket wrappers).
EDIT: Wow. My post wasn't really helpful at all. Sorry!
Last edited by cactus (2010-09-04 09:16:54)

Similar Messages

  • Java Swing and Socket Programming

    I am making a Messenger like yahoo Messenger using Swing and Socket Programming ,Multithreading .
    Is this techology feasible or i should try something else.
    I want to display my messenger icon on task bar as it comes when i install and run Yahoo Messenger.
    Which class i should use.

    I don't really have an answer to what you are asking. But I am developing the same kind of application. I am using RMI for client-server and server-server (i have distributed servers) communication and TCP/IP for client-client. So may be we might be able to help each other out. My email id is [email protected]
    Are you opening a new socket for every conversation? I was wondering how to multithread a socket to reuse it for different connections, if it is possible at all.
    --Poonam.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Daemon and socket programming

    Hi,
    I have been given a new project whereby I have to:
    1) Write a class with a method that takes as an argument an xml document, communicate s with a SOAP server and return the SOAPs response (in this case a ResponseWrapper object).
    2) This then has to be implemented as a Daemon, that listens to a particular socket.
    The reason for this being is that it can be uploaded to a server, allowing a pearl program to send the XML to the Daemon, have this contact the SOAP server and then return the SOAPs response back to the pearl program.
    I am aware that this sounds unnecessarily complicated but it does have to be implemented this way.
    I have written the class and it successfully communicates with the SOAP server and returns a response, but have no idea how to implement it as a Daemon and have had no experience with socket programming.
    Could anyone point me to a tutorial or give me some pointers in how to get started?
    Thanks,

    It was an option to use a Web Service, but I was told
    that due to security issues it would take to long to
    write all the necessary checks and interceptors
    (which I know how to do), so I should implement it
    this way (which I don't know how to do); since it is
    sitting behind the firewall it would not be
    accessible for spoofing.Huh? You realize that tons of very sensitive information is transmitted all over the internet using Web Services right?
    I have had no experience
    with implementing this type of thing before, What is your level of experience then? This may be over your head. I'm not saying that sockets and daemons are advanced concepts, but I wouldn't throw a beginner into that task.

  • IPAddress and socket programming

    hi frens,
    I'm doin a project of storage area networks in which there could be as many servers or storage devices in the network.
    My problem is if suppose a particular server on the network is communicatin with other server how will i know the IpAddress/name of the other server which is communicating.
    Is there any direct method in java.net as such by which i can get the IpAdd/name of the other server talkin to a particular server.
    IF not how do i go bout it?
    jyoti

    >
    Is there any direct method in java.net as such by
    which i can get the IpAdd/name of the other server
    talkin to a particular server.
    IF not how do i go bout it?Depends on what you mean.
    If you have the server name then DNS look up will work. You provide the server name rather than the IP address and the DNS server on your network will translate it.
    If you want to discover the server on your network it is more complicated. Basically you iterate through the IP addresses on your local network and try to connect to each. There might be a discovery protocol in place for this already (you broadcast and they respond) but that depends on the service.
    And as a word of warning, if you are working at a company/institution with a security adminstration then you should get authorization from your supervisor in writing to run a discovery interation on the network. Any firewall of any sort will flag such a process as a hack attempt and will notify the security adminstration - which could get you fired/terminated. With the authorization your job/position is protected. Basically if you don't know the head of security on a first name basis then the company/institution is too big for you to take the chance.

  • Opening network and programs on start up

    I've recently talked my boss into up dating computer at work there imac G3's running 9.2.2 how do I set computer to log on to network and open program on start up.

    If you are continuing to use OS 9, any alias you place in the "Startup Items" folder inside the System Folder will be opened on Startup, for a single-user OS 9 Mac.
    If you are using Multiple Users, this may change a little. Each Users may get his own private "Startup Items" folder which would launch when that user logs in.
    "to log on to network"
    I am not certain what you mean by this. Get on the Internet and do a google search? Look up your files on a company Server? validate your user ID?
    There are ways of using a Mac OS X Server, 10.4 or earlier \[the feature for controlling OS 9 computers is not available in 10.5 Server] to control system-wide user-ID verification and file control. You could also use older software, such as AppleShare IP for this. What I am describing is used in schools, so that any user can use any computer. All User files are stored on the Server, and any workstation computer can be sent out for service on a whim -- the individual workstation computers have no user-specific files on them. Backup is centralized, and can be done in a comprehensive way.

  • RESTFUL Web Services vs Socket Programming Performance

    Hi guys,
    I will have an application which will have a service serving about to 30 million users/day and a mean of 5 requests/user.
    It means that there will be about 150 million requests per day. I will have two servers behind a load balancer and my clients will be both Java and C++.
    I think to implement RESTFUL Web Services but afraid of performance issues.
    Did you have a knowledge about the performances of web service and socket programming in such a high loaded project?
    Tnx.
    Ayberk

    ayberkcansever wrote:
    Hi guys,
    I will have an application which will have a service serving about to 30 million users/day and a mean of 5 requests/user.
    It means that there will be about 150 million requests per day. I will have two servers behind a load balancer and my clients will be both Java and C++.
    I think to implement RESTFUL Web Services but afraid of performance issues.
    Did you have a knowledge about the performances of web service and socket programming in such a high loaded project?It depends on the CPUs, RAM, disks, and network configurations of those servers.
    It depends on how the requests are distributed throughout the day.
    It depends on how big the requests are and how big the responses are.

  • RMI and Traditional network socket programming

    Friends,
    Please help me
    What is the advantage of RMI over socket programming ?

    you may need to refer to a good RMI book for having a detailed answer. Since they are quite a few of em.

  • How to run a datagram socket client and server program

    hi,
    I am new to socket programming. I am following the tutorial of sun for socket programming...The link is
    http://java.sun.com/docs/books/tutorial/networking/datagrams/clientServer.html
    I have understood the concept, but the problem is i cannot run the program. I am using netbeans and i have created a package and stored the files QuoteServer,QuoteServerThread, QuoteClient in this package. How can i make the server program run first and then client program in netbeans
    kindly help me
    Thankyou

    I think you are trying to run both server and client
    on one machine!!!
    It is impossible, your server is blocking the port to
    send packets, so you must run client on another
    computer!!!It's not impossible to run a client and server on the same machine just for testing or as a demo. Just have the server listen on one port and the client use a different port.
    No need to use 2 seperate computers. I've done it one computer before without a problem.
    Nick

  • Can i run UDP  client and UDP  server socket program in the same pc ?

    hi all.
    when i execute my UDP client socket program and UDP server socket program in the same pc ,
    It's will shown the error msg :
    "Address already in use: Cannot bind"
    but if i run UDP client socket program in the remote pc and UDP server socket program run in local pc , it's will success.
    anybody know what's going on ?
    any help will be appreciated !

    bobby92 wrote:
    i have use a specified port for UDP server side , and for client define the server port "DatagramSocket clientSocket= new DatagramSocket(Server_PORT);"Why? The port you provide here is not the target port. It's the local port you listen on. That's only necessary when you want other hosts to connect to you (i.e. when you're acting as a server).
    The server should be using that constructor, the client should not be specifying a port.
    so when i start the udp server code to listen in local pc , then when i start UDP client code in local pc ,i will get the error "Address already in use: Cannot bind"Because your client tries to bind to the same port that the server already bound to.

  • Networking and programming

    why is that in all the universities networking courses has programming in it?

    Hi ,
    We do need to telnet the elements but it is via. script.
    It is mainly useful when you have 1000 devices (I mean not exactly 1000 but more # of devices) in network
    and you want to configure some command in all devices where script is actually in  use. It will login to all devices and do as per your instruction.
    I am preparing script where script will login to device and take output of few commands and store it in file ..and after completing some activity on that device (Like card changing , some BGP changes) it will again take outputs and compare it with previous one and will tell me if there is any evolution due to this activity performed.
    I hope this information is useful.
    Regards
    Mahesh

  • Our iPad air keep kicking out of the Apple TV. None of the other iPads we have on the same network and the same content do this. The program kicks off the AppleTV and starts playing on the iPad about every 10 minute

    We have used the 2 Apple TVs and the 5 different IPads successfully on both Apple TVs. But the iPad air, on the same content, on the same network, on the same Apple TV drops off the Apple TV and the content starts playing on the iPad. When we choose Apple TV on the AirPlay button, it starts playing on the TV again. It does this about 6-7 times an hour. We have the latest software update. We have also deleted and reinstalled the App to play the context (iView) and it still does this.

    Hey there TandViv,
    It sounds like your other iPads work correctly when Airplaying to your Apple TV, but one disconnects about ever 10 mintues or so. I have a few thoughts for this issue you are seeing. First, try closing all the apps:
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    Double-click the Home button.
    Swipe left or right until you have located the app you wish to close.
    Swipe the app up to close it.
    When you have done that restart the phone and test it again:
    iOS: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/ht1430
    If the issue persists try resetting the network settings on the phone and see how that works:
    Reset network settings by tapping Settings > General > Reset > Reset Network Settings. Note: This will reset all network settings including:
    previously connected Wi-Fi networks and passwords
    recently used Bluetooth accessories
    VPN and APN settings
    From: iOS: Troubleshooting Wi-Fi networks and connections
              http://support.apple.com/kb/ts1398
    If the issue persists, I would next backup your device to iTunes, and restore it:
    iOS: How to back up and restore your content
    http://support.apple.com/kb/HT1766
    Thank you for using Apple Support Communities.
    All the best,
    Sterling

  • TCP/IP socket programming in ABAP

    Hi,
    Is there any method of TCP socket programming in ABAP? For example is there any function module for creating a socket for a IP address and port number. After that, is it possible to send binary/text data to a connected IP/port destination. I need such a solution because I need to send raw data (native commans) to barcode printer on our network which has a static IP address and listens incoming data through a fixed port number specified in its documentation. For a solution, I coded some .NET VB and built a small application that acts as a RFC server program which can be called by SAP according to definitions I made in SM59 (I defined a new TCP connection and it works well sometimes!). In this application, data coming from SAP are transferred to the barcode printer. This is achived by the .NET Socket class library. This solution works well but after a few subsequent call from SAP, connection hangs! SAP cannot call the application anymore, I test the connection in SM59 and it also hangs, so I need to restart the VB application, but this is unacceptable in our project.
    As a result, I decided to code the program that will send data to the printer in ABAP as a function module or subroutine pool, so is there any way to create a socket in ABAP and connect to specific IP/port destination? I searched for possible function modules in SE37 and possible classes in SE24 but unfortunately I could not find one. For example, do know any kind of system function in ABAP (native commands executed by CALL statement), that can be used for this purpose?
    I would appreciate any help,
    Kind regards,
    Tolga
    Edited by: Tolga Togan Duz on Dec 17, 2007 11:49 PM

    Hi,
    I doubt that there is a low level API for sockets in ABAP. There is API for HTTP but probably that won't help you. As a workaround you can use external OS commands (transactions SM69 and SM49). For example on Unix you can use netcat to transfer file. Your FM needs to dump data into folder and then call netcat to transfer file.
    Cheers

  • [Urgent]3G Socket programming

    May I use socket for 3G networks?
    I use the demo provided by the WTK2.5-Beta(NetworkDemo), it works well in the simulator. However, when I download the program to the mobile phone, it seems that the mobile phone that runs ServerSocket cannot create the socket ... all the 2 handsets use a 3G SIM card provided by a Hong Kong ISP smartTone ... What can I do?
    Please help~ provide any web page of codes, thanks very much!

    1.     We want to create a socket connection which can
    remain open and live for ever till it is closed. Is
    this possible in java socket programming?Yes, but it isn't practical in the real networking world. So your code had better be prepared to deal with network failures.
    2.     I am just wondering in order to communicate with
    the third party over the socket connection, does this
    other party requires to run something specific on
    their end? I am not able to understand how will my
    java code communicate with their server otherwise.It has nothing to do with java. Sockets send and recieve messages. The applications at either end, regardless of the language that they are written in, must handle those messages.
    3.     Can we send and receive data over the socket
    created and also is their specific format for the
    data? Yes.
    Can we send files of data over this connection?Yes. (Although I don't know why you would need to do that if you are doing credit card auths.)
    It would be great if someone can comment on these
    questions and also if possible please provide some
    code that can create socket connection.The tutorial.....
    http://java.sun.com/docs/books/tutorial/networking/sockets/index.html

  • IP address lookup and Sockets

    Hi All,
    I have created a Socket using java.net.Socket(String host, int port) by passing the required host, port parameters.
    The host string is specified in the form of xxx.xxx.xxx.xxx, even though the Java
    program(client) is running on the same machine where the server socket is listening, (IP address is not specified as 'loopback address' localhost/127.0.0.1).
    Below are my queries for the above mentioned scenario.
    1) When the data is sent/received to/from the Socket, will the data
    travel across the network and return back to the same machine or it will be a direct send/receive within the same machine?
    2) Is the loopback address 'localhost/127.0.0.1' used internally by the underlying socket implementation without performing lookup of the IP address in the network?
    3) Does this behavior varies/depends on the underlying OS or the network
    protocol/configuration?
    Thanks in advance,
    Sreenivasulu

    1: it depends upon the mechanism through which the sockets between client and server are established (in ur case the client and the server is the same machine). When u specify the localhost/127.0.0.1, port where the server is listening, then i think the request should go out to the network and the OS will handle it by it self and manage the connection then the data will not travel through the whole network. Other wise when u specify that the server is listening on 192.168.0.0:9000 then the OS will go to look up server /dns it will tell him where this system in laying on the network is it in he same netwrok or out side this network and then a connection is established now the data will travel through the network, cause it will look for the system 192.168.0.0.
    2: when u will use the loopback for specific IP then the direct connection is made to the system.
    3: i can say nothing about this issus how the other OS are behaving cause i had mostly worked on Windows NT/2000
    i am in the learning process. If i am wrong plz correct me. And i am also very much interested for the replies from other users...
    thanx

  • Help on Server Socket Programming??????

    hello Friends,
    I need your help on following:
    I am the only person working on this project and the company wants me to prepare a infrastructure of this project and I should also give a demo of this project to my seniors. I will breif you up with my project:
    1. There is this gif image of distillation column. i will be publishing it using JApplet or Applet.
    2. This Image must be seen on internet.
    3. On the circle of these Image the user will click(In all there are five circles, called as controllers)and a dialog box should open thru which user will input the float values(I am using the JOptionPane class to open this dialog box).
    4. The inputed values will the be given to the C program which is the simulator for distillation column.
    5. The C program will generate the output through iterations(Code entirely in C), the output of each program will then be poped up to over the image beside the respective controlled or under the respective controller but definetely over the same gif file.
    6. The number of iteration will depend on how fast the C program converges the inputer parameters. And each output must be show over the gif image and when the final iteration value will appear it should remain on the image until some new value is inputted by the user again by clicking on any of the circle.
    The proposed theory to do this project accoding to me is as follows:
    1. Since each value must be thrown to the user. I beleive this is a real time project. So I decided to use Client Server Networking technology provided by java.
    2. Then I figured out that in this project there should be 2 clients One is the GUI which is the Image screen to receive the input from the user and to show the output to the user. Second client is a java program sitting behind the server which will receive this input data from user and it will have an NATIVE method through which all this input will be given to the C simulator program.
    3. The middle bridge between these two clients will be a server. Which will just pass the data to and fro from both the clients.
    3. The C program will perform iterations using these input values from second client. This C program will then give each iterations output to the Java program using JNI technology. This second client then sends this output value to the GUI clients through server.
    Well another very important thing, I am inexperience in the field of software so I had to do a lot of R&D and this is what I found out. Frankly I am really not sure whether this is the right path to approach to this project or there is some other correct and realistic way than this? Well friends i would certainly request you if you can suggest some other simple or rather correct path or else if this is the right path then would you please suggest me the possible hiches or perticular points where I should concentrate more.
    Well i am eagerly waiting for your reply.

    Since you are publishing your results on the net , it will be a better idea to use JSP?Servlet/Beans architecture instead of swing
    I will propose a architecture as follows:
    Client : Standard Browsers, IE and NS
    Middle Tier: Java Webserver/Application Server
    This will depend on your budget. If u have a fat allowance go for weblogic/websphere . If u are operationg on shoe string budget try for apache , etc
    In the server tier code your application in the follwing architecture
    JSP for presentation: Distillation towers picture, input boxes .. etc
    Servlets for business logic invocation and routing requests: Your JSP submits input values to servlets, which does the processing using Java Bean Components. Since you have a lot of Logic written in C I would suggest to encapsulate these in JavaBean components using JNI technology and reuse the code.
    After processing the servlet again forwards the response to another JSP for output
    Advantages:
    1.Your clients can be thin as most of the processing is done at the server
    2. Thread Management is taken care of by your webserver, which otherwise would be a headache
    3. Writing this through low level socket programming will be much more difficult as you will write your own protocol for communication this will be error prone and not scalable
    If you still decide to go for traditional client server programming using swing, use RMI for communication as I insist that socket programming is very very cumbersome...using your own protocols
    hope this helps
    Shubhrajit

Maybe you are looking for

  • Problem in displaying data in the smartform output.

    Dear Freinds,                 I have a requirement as per my requirement i have to display the employee dependents details in the smartform output. I have taken a table in smartform and collected all teh employee dependents details . Each dependents

  • Ipod not coming up in windows explorer

    when i connect my new ipod, i get the found new hardware wizard, and it searches but cant find anything. I have the same problem with 2 other nokia phones(n95 and n73), and now i have just bought a 60GB external hard drive which has exactly the same

  • Burning movies to DVD using imovie

    I downloaded some movies I took from my Canon FS100 to iMovie. How do I burn them on a DVD?

  • Export? Render? Share?

    I would like to be able to EXPORT my Slideshow from iPhoto5 then IMPORT it into FCP5 for editing/effects. Is this possible? SHARE>SEND to iDVD this rendered and took me to iDVD... but I just want a .mov or something. I don't want to have to use an al

  • Screen Sharing in its own Space?

    I'm trying to figure out a way to get one of my spaces to function solely as a place to check my other computer over then network/internet via the built in Screen Share app. I'd like for the space to function with the other computer exclusively (comp