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.

Similar Messages

  • 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.

  • Java network socket programing

    What the mean for the
    getIsTransvering?
    and also what the mean for:
    mClientConnection.getIsTransvering()
    synchronized (mClientConnection) {
    mClientConnection.notify();
    }

    There must be some comments at the same place you got that.
    Of course, it is impossible to answer otherwise, insufficient input by you.

  • 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)

  • NIO and traditional sockets

    I have a little server that I was porting from traditional thread per socket programming to NIO. The first thing I ported was the Listen-Accept loop. This worked well but the resulting sockets obtained from
    SocketChannel.socket()
    have very strange behaviour with respect to flush. I send the data by
    out.write(data);
    out.flush();
    where out is the BufferedOutputStream. The data doesn't get sent until the next input arrives on the Socket. If I change to using just old style I/O or completely NIO the problem goes away.
    I found several bug reports on NIO and flush, but they all seem to be considered Feechures by SUN.

    Thanks for posting the link to your NIO code. I downloaded the src-raining-1.2pre1 source and took a look. I noticed that you still have some doubts about how OP_WRITE works. This piece of code will definitely have problems.
        public void setSendData(ByteBuffer data) {
            this.write_pending = true;
            wBuffer = data;
            //RK modified on 20031008 23:19:39 - NOOO
                    //registerChannel(selector, channel(), SelectionKey.OP_WRITE);
            // RK modified on 20031009 23:15:00 adding write interest
            SelectionKey sk = sc.keyFor(selector);
            int ops = sk.interestOps();
            sk.interestOps( ops | SelectionKey.OP_WRITE);
            selector.wakeup(); // is this required or not ???
        }The sk.interestOps will block if there is an active select. If there isn't an active select you don't need the wakeup. The only way to make this work properly in 1.4.2 is to build a queue of runnables that set interestOps and execute them just before or after the select. Also the setting of OP_WRITE in that code won't handle the case where the network exerts flow control on the channel. The correct setting of OP_WRITE is
    - set interest in OP_WRITE when the socket is connected
    - remove interest as soon as you successfully write all the data in a buffer
    - add interest only when you write less bytes than requested.
    My post Taming the NIO Circus provides an example of this in the swing based client. I posted this in response to Java.nio. SelectionKey interestOps(int) method blocks

  • Difference btwn RMI and Network prog.

    Hello to all,
    iam currently learning RMI and pls tell me what is the difference between RMI and Network Programming(using sockets....)
    Thanx in advance.

    RMI sits on top of sockets and basically lets you send objects over the wire. Network programming is underneath and it handles all the transmission issues.

  • 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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • TS3694 Hi I am trying to update my I Tunes to 10, the message I get is ,, The feature you are trying to use is on a network that is unavailable,, click ok to try again, or enter and alternative path to program I Tunes.msi ....HELP

    Hi I am trying to update my I Tunes to 10, the message I get is ,, The feature you are trying to use is on a network that is unavailable,, click ok to try again, or enter and alternative path to program I Tunes.msi ....HELP

    What computer OS and version do you have?
    If you have windows try:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    or
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP

  • 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.

  • Can we use applets as user interfaces with sockets, RMI and J2EE

    Dear Sir or Madam,
    Since I am a TA for software architecture class, some one ask me the following question: I think the answer is "No" based on the document on http://java.sun.com/sfaq/
    How I answer the quesions? Looking forward your help!!!
    1.You may have 2 applets and 2 html files. One applet with one html file may stay at a client PC and run on this PC, and the other applet with the other html file may stay at a server PC and run on this PC. In this case, all the applets are run locally.
    2.Could applets works with sockets, RMI and J2EE?
    3.Can we use applets as user interfaces with sockets, RMI and J2EE?
    Thank you very much!
    Best regards,
    Jing

    The scenario you paint doesn't quite make sense. The "server PC" wouldn't be running an applet, normally, since applets are by definition in a web browser page, and most likely involve user interaction, and "server processes" generally are done without user interaction.
    The security rules around applets are that -- by default -- applets can connect with sockets ONLY to the server from whence the applet was loaded. RMI uses sockets (J2EE is too broad a spec) and hence RMI calls would also be limited to the server from whence the applet was loaded. Within that limitation, an applet could open all the sockets it wants, so long as they are all on the server from whence the applet was loaded.
    If you want two applets on two different systems to communicate with each other, the simplest way is to have them rendevous through a server process on the server(s) from whence each applet was loaded. Maybe it's PC-a <-> server-a <-> server-b <-> PC-b ...? Or maybe PC-a and PC-b both are talking to the same server.
    The limitation is rooted in the security subsystem. You can specify a policy file and override anything in the security subsystem. That does mean signing the applet and then cajoling the user into agreeing to grant greater levels of security than the default. In such a case you can open sockets more broadly and then PC-a could talk directly to PC-b without going through any servers.
    - David

  • 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

  • Network Adapter Programming in Java

    Hi all,
    I need to send a signal from my computer to antoher computer using a Java program. The two computers are connected with the help of a network adapter (like an ethernet card). How can I do this in java? Is RMI helpful in this scenario? Any help or examples will be appreciated.

    Hi,
    I have two network adapters on the same computer
    and I have configured them to use a parrrticular ip
    addresses. Now I connected them using ethernet card.
    I am using socket program to send the signal between
    the two adapters. I have the problem like i get same
    ip address for both client and server, ie i cannot
    run client one ip address (10.1.1.1) and server on
    the other ip address(10.1.1.2). Is there any other
    way to approach the problem? Any suggestions?Is this for testing? If not please help me understand why you are using the network adapters and sockets instead of just communicating directly? Thanks

  • 2 RMI Questions:"RMI and Marshalling" and...........

    Hi,
    Its not a programming Q. but its a conceptual Q. In all most all the websites related to RMI, I have seen refrence of Marshalling in the context of data encoding. In socket programming, we also do data transfer but there is no Marshalling? What is the reason of Marshalling in RMI? Is it because of Java to Java communication and for socket we use TCP/IP so we leave the Marshalling to the Network Interface Card??
    Zulfi.

    Thanks for your reply. Ok Marshalling is clear but I have to run a program and then we will discuss more about Marshalling. However after reading the doc specially about stubs
    The caller invokes a method on the local stub which is responsible for carrying out the method call on the remote object.
    In one other doc, I read the samething about dispatcher. Each machine has a local dispatcher . The client communicates with local dispatcher which then communicates with remote dispatcher and then returns a communication channel back to client via local dispatcher. So is it that these stubs and skeletons are basically the dispatcher component?
    In one other doc., http://cs.gmu.edu/~setia/cs571/slides/rmi-proj.pdf , I found that there is no dispatcher component on the client side? Which is correct?
    Zulfi.

  • My ipad does not appear in itunes. I am OS 10.6, itunes is up to date, I have restarted computer and ipad and switched usb sockets. Dont know if its related, but I can no longer see my sony handycam in imovies too.

    My brand new iPad 2 does not appear in iTunes. I am OS 10.6, iTunes is up to date, I have restarted computer and iPad and switched usb sockets. Don't know if its related, but I can no longer see my Sony Handycam in iMovies too.

    What content are you wanting to copy of the iPad ? You should be able to copy off anything that you've purchased from Apple (films, music, ibooks, apps etc) by connecting the iPad to your computer's iTunes and doing File > Transfer Purchases. If you want to copy off music copied from your own CDs or purchased from other sites then you will need to find a program for your computer that can copy them off – iTunes won't copy them off.
    For photos taken with the iPad, copied to it via the camera connection kit or saved from emails/websites then you should be able to copy them off via the Windows camera wizard.
    For photos that were originally synced from a computer you will need a third-party app such as Simple Transfer which can copy them off via your wifi network. But as photos are 'optimised' when they are synced to the iPad, any that you then copy back to a computer may not be exactly the same as they originally were on your computer.
    Content in third-party apps (documents and files etc) then how you copy that content off will depend upon what the apps that they are in support e.g.either via the file sharing section at the bottom of the device's apps tab when connected to iTunes, via wifi, email, dropbox etc.

  • 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

Maybe you are looking for

  • FDMEE BefImport script for SQL source

    Hi Experts , I am new to FDMEE and trying to implment it for our process which should pull the data from one of the SQL view and load into Essbase. I am trying to use the Open Interface table and hence trying to builde BefImport event script with hel

  • Error loading ejb application

    hi am geting blue ring turn turning when deploying my application and it showing a word downloading *** Using HTTP port 7101 *** *** Using SSL port 7102 *** "C:\Documents and Settings\Desmond\Application Data\JDeveloper\system11.1.2.1.38.60.81\Defaul

  • Old Iphoto book was changed when I opened it. How to revert back?

    I have 2 previous Iphoto books that I made and now I have Iphoto11. When I clicked to open one of the books, Iphoto11 totally changed the book and made it into a new version. How do I get the old version back the way I had it?

  • Import adresses to Pages from Numbers

    Hi. I have Pages 5.1 and Numbers 3.1. Can anybody tell me if it's possible to import adresses from a Numbers documet to a Pages document. I have a letter I want to send out to a lot of people. But I don't want to type the name and adress into every l

  • May be a bug.. please look into this

    Hi, for ex: there is a table like desc trade; trade_date date day_high number day_low number day_open number day_close number there are many records right from trade_date 01-jan-05 to till date. If i want to query records of any perticular date retur