Java Socket on low bandwidths

Hello!
I am currently working on a project where we try to use Java technology (through Jini) over an HF radio link. That means we're working with bandwidths down to 75 b/s. And we are experiencing what we suspect is a timeout when we try to make a new Socket.
What happends is we get a 'NoRouteToHostException: connection timed out', and it seems to us that this happends in the Socket constructor. That means we never get the chance to set the SO_TIMEOUT or other Socket parameters since the exception (seemingly) is thrown during Socket creation.
This is mainly a problem on the lowest bitrate (75 bits per second), but we have also experienced this with 150 b/s. Not on a regular basis, though.
We are about to write this off as being caused by some timeout in the Socket constructor which we have no chance to modify, but we would welcome any information that can help us understand this.

75 b/sSo you get an effective rate of 9 bytes per second.
That sounds like fun.
Presume the IP packet size is 128 bytes And there is also a host lookup then it takes a minium of 4 packets. Which means 56 seconds to connect. And that is with no processing time. And no lost packets.
Are you using a host name or just an IP? If the host name I believe you can do a lookup on that first and then use the IP. That would make a timeout less likely.

Similar Messages

  • Using plain Java Sockets(not RMI) how..?

    hi!
    1. Using plain Java Sockets(not RMI) how can the client detect when its server
    goes down?
    There is a long time interval between client requests and the client wants
    to retain a live connection rather than disconnect after every reqest.
    Please also cc your reply to [email protected]
    Thanks,
    \Raghu

    If you try to send data when the host is gone, it throws an exception. I don'thow to check if it is alive though. I'm having the same problem right now.

  • Java socket - unsure road to take!

    Hi all,
    We have an application requiring data transfer from a JSP Web application (socket client) and a stand-alone java application (socket server).
    This java stand-alone app communicates to an industrial microcontroller connected to the RS-232 serial port.
    When this java apps received a command from the JSP web app, it cannot service any other command from other uses, since there is just one RS-232 serial port on the computer. We would like to rely on the java & network environment to buffer additional commands receive simultaneously, as opposed to write code on the java socket server to handle this. In other works, our java stand-alone operates in an assynchronous, single-task mode.
    We are unsure which approach to take as far as java socket goes:
    1) simple socket server/client;
    2) multithread socket
    3) pooled
    Can anyone advise us.
    Thank you
    Trajano

    Hi Pete,
    1) Yes, we can have more than one user trying to access the micro-controllers, because we have in reality a network of micro-controllers connected to the single RS-232 computer port via a RS-485 to RS-232 converter;
    2) If a second user tries to issue a command to micro-controller, I would prefer for the java socket/environment to take care of the buffering, by just delaying the response, until the first user gets its command serviced
    3) If there is 1 user, him/her might issue several commands at the same time, by opening several JSP pages;
    4) No the controllers can service any instruction coming up at any time. The protocol is master/slave. The java app issues a request and the micro-controlle replies back and ready to accept any other request.
    ISSUE: My preference is for the system to take care of commands arriving at the socket server.
    This java app has two threads:
    1) Thread1 is the java socket server and upon receiving a command it will update three (3) properties:
    micro-controller address, command and product code
    2) Thread32 will be responsible for polling the 3 properties to check if they've changed. Upon detecting a change, it will build the data string and send to the RS-232 serial port.
    Any ideas/suggestions.
    Thanks in advance for any assistance.
    Regards

  • Java socket streams messing up

    iv wrote a games server and it uses java socket streams to send the messages back and forth between the game clients and the game server it self
    this all works great but when running and over about 5min its send over 1000 packets BUT
    it will crash iv found the reason is down to when reading the packets my parser is reading wrong part and grabbing a String part when it should be a INT
    now it should NEVER be reading this part of the packet so i put a trace on the packets coming in and ran it every packet was been read in perfect THEN just befor the crash TWO packets were merged together stright out from the socket stream this is y my packet reader was getting confused
    what im asking is can this happen in java sockets ? i thought they were bufferered so no matter how fast you send data it would always read it out in the same order ?? not sure how its merging these to packets
    is this possible of is my reader got an error in it altho works 95% of the time ??

    or do you have multiple buffered streams created from the same socket?

  • Low Bandwidth UI customization

    Does anyone know if it is possible to customize the UI in the low bandwidth version of Plumtree and can this be my users default? Or would it be possible to get certain sections of the portal such as the Document management and Forums to behave in the Standard Portal like they do in the Low Bandwidth version?

    Hi Abhinay ,
    Follow the following URL's which can help you with to complete the UI customization of OIM
    * http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/uicust.htm
    * http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/uicust.htm#BABJIJIA
    Thanks

  • Socket AS3 ( Receive File .TXT ) + Java Socket

    Hi,
    I have Java Socket sending .TXT file ( 10 MB ) . But the AS3 only gets 63 Kb . I do not understand the loss of bytes ...
    Souce Java :
    public void sendFile(String fileName) {
            try {
                //handle file read
                File myFile = new File(fileName);
                byte[] mybytearray = new byte[(int) myFile.length()];
                FileInputStream fis = new FileInputStream(myFile);
                BufferedInputStream bis = new BufferedInputStream(fis);
                DataInputStream dis = new DataInputStream(bis);
                dis.readFully(mybytearray, 0, mybytearray.length);
                OutputStream os = clientSocket.getOutputStream();
                byte[] fileSize = intToByte(mybytearray.length);
                byte[] clientData = new byte[(int) myFile.length() + mybytearray.length];
                System.arraycopy(fileSize, 0, clientData, 0, fileSize.length); // Copy to the file size byte array to the sending array (clientData) beginning the in the 0 index
                System.arraycopy(mybytearray, 0, clientData, 4, mybytearray.length); // Copy to the file data byte array to the sending array (clientData) beginning the in the 4 index
                DataOutputStream dos = new DataOutputStream(os);
                //dos.writeUTF(myFile.getName());
                //dos.writeInt(mybytearray.length);
                dos.write(clientData, 0, clientData.length);
                dos.flush();
    AS3 Source..
    private function onResponse(e:ProgressEvent):void {
      var file:File;
      var fs:FileStream;
      var fileData:ByteArray = new ByteArray();
      file = File.documentsDirectory.resolvePath("tmpReceive.txt");
      fs = new FileStream();
      fs.addEventListener(Event.CLOSE,onCloseFileReceive);
    if(_socket.bytesAvailable > 0) {
      while(_socket.bytesAvailable) {
      // read the socket data into the fileData
      _socket.readBytes(fileData,0,0);
      fs.open(file, FileMode.WRITE);
      // Writing the file
      fs.writeBytes(fileData);
      fs.close();

    Crypto streams, like CipherInputStream andCipherOutputStream, do not behave properly until you
    issue a close() call. So if you are going to do
    crypto, you will need to trap the close() before it
    reaches the underlying socket streams. This is
    because the close() method finalizes the cryptographic
    operation. (Flush() would make more sense, no idea
    why they did it this way). You do want to finalize
    the crypto for any given message, but you need to trap
    the close() before it hits the socket and ends the
    whole affair.
    I don't see anything about that in the bug database.
    No matter what streams you are using, if you aregoing to keep the socket open for multiple
    request-response round-trips, you need to very closely
    pay attention to how much data is being sent on each
    trip. Normally, you can fudge this a bit on a
    request-response because the close() call on the
    output stream will cause the receiving input stream to
    behave more or less properly. However, a flush() will
    not.Why not? I use that all the time with no problem.
    A good practice is to send the content-length of
    the message first, so the receiving input stream
    "knows" when to stop reading, does not block, and then
    can send its own bytes back the other direction.
    (Where the process is repeated).
    An alternative is to use two threads: read and write.
    The read recieves, parses, validates and then pushes complete messages to a queue.
    The write pulls messages from the queue, processes and send a result.
    A variation to the above is what happens when an invalid message is received. The server can ignore it, the read can send a error response, or the read can push a message to the queue which causes the write to send a error response.

  • JAVA SOCKET TIMEOUT WHEN GENERATING PDF TO ADS SERVER

    We are currently getting the error when attempting to generate the PDF from the thin portal BI Reports and recieved the JAVA SOCKET READ TIME OUT error and
    applied adjustments to the notes
    934725 and 826419 by changing the timeout sessions to 300, but still get the same timeout errors:
    Note: We changed ADUSER user type and password, passed rpcData test, RFC HTTP external connections to ADS server...so we've came a long ways and here we are now with the timeout errors...
    Any ideals???

    Hi
    when you reset password please select checkbox for password never expires.
    see the following notes :
    1.Note 944221 - Troubleshooting if problems occur in forms processing
    2.Note 811342 - Time Out exception when rendering to Adobe document service
    thanks
    Gopal

  • Can java be a low level programming language??*

    can java be a low level programming language??
    can anyone answer this question and explain it why?
    please please please...�
    [email protected]

    strike one: you are asking an obvious homework type program without showing any evidence of having done any work of your own first. Please show your work first. This isn't a homework service.
    strike two: you are cross posting here and in the "new to java forum". This irritates many of us to no end as we end up doing volunteer work to solve a problem only to find that its already been solved in another thread. So we've wasted our time for nothing. Don't do this.

  • FF resolution settings to lower bandwidth usage

    Which versions of FF will do this and what specific settings are there to lower bandwidth usage?
    Also, will the FF settings override settings on websites such as youtube? For example, if my kids were to click on higher resolution or HD video settings for their youtube videos, what would happen?

    Changing the resolution doesn't have any effect on the Firefox performance and may even look worse if you operate an LDC monitor not in its native resolution.
    You can block content if you ant to improve performance on a low bandwidth connection.
    You can look at Adblock Plus.
    * Adblock Plus: https://addons.mozilla.org/firefox/addon/adblock-plus/
    You need to subscribe to a Filter list (e.g. the EasyList).
    * http://adblockplus.org/en/subscriptions
    * http://adblockplus.org/en/getting_started

  • The service bit "write enable" in Java Socket

    Hello,
    I am trying to communicate with a third party application and I am having some problems. I use a standard Socket connection, were my application is the Server (ServerSocket). The connection is established, but no data is transmitted.
    I talked with the guys behind this third party application, and they said that perhaps their application does not receive a "write enable" service bit of the tcp/ip protocol. I'm not a network wiz, so this is an unknown territory for me.
    So I ask you. What is this "write enable" tcp/ip service bit? Is this per default on in java socket connections? If no, how can I change this?
    Perhaps this is very basic knowledge, but I've googled a bit and have not found this "service bit".

    This could refer to something in their
    protocol which you aren't implementing correctly.Probably, but I believe they have "forgotten" to mention that it is required in our implementation.
    OTOH if you are the server the transaction would
    normally begin with a request from the client, not a
    write-enablement from the server.The defined protocol smelled fishy when reading the "whitepaper", but we had to accept it (politics).

  • Java sockets (peek functionality)

    Hi,
    how do i peek at a datagram, look into the data and accordingly
    decide whether to consume that datagram or leave it for later
    processing?
    Is this something Java sockets readily support OR do I need
    to implement some kind of store-for-later-processing
    please help
    Thanks.

    java.net.DatagramSocket doesn't have peek support in the API at this time - see 4102648.
    If you were to use a non-blocking DatagramChannel and register it with a Selector then you should be notification that a packet can be read. Okay, it doesn't give you the details - just that a packet is available but it may help in your environment.

  • Java sockets forwarding (redirect)

    Dear all
    I’m try to write a java sockets program which will accept VNC connection and forward it to another pc that has VNC server installed.
    That is: a client use vnc viewer connect to a JavaServer(where the sockets program run), the JavaServer accept this connection and forward it to the VNC server
    The reason doing this is because the client can only connect to the JavaServer, and the JavaServer has the ability to connect any host.
    I can manage to initiate the connection, and give the password that the VNC server request with the following code, but after this just before the viewer start to show the remote desktop, the sockets stuck on reading.
    can anyone help me out please.
    public void listen() throws Exception
    ServerSocket server=new ServerSocket(443, 5);
    System.out.println("Start Listen ...");
    while(true)
    Socket serverCon=server.accept();
    System.out.println("get Connection from: "+serverCon.getInetAddress());
    InputStream serverIn=serverCon.getInputStream();
    OutputStream serverOut=serverCon.getOutputStream();
    Socket targetCon=new Socket("192.168.1.3", 5900);
    InputStream targetIn=targetCon.getInputStream();
    OutputStream targetOut=targetCon.getOutputStream();
    byte[] buf=new byte[10240];
    int len;
    while(true)
    len=targetIn.read(buf);
    System.out.println(len);
    serverOut.write(buf, 0, len);
    len=serverIn.read(buf);
    System.out.println(len);
    targetOut.write(buf, 0, len);
    }

    Hi EJP
    Thanks for your reply,
    I did try to use threads with pipeStream,
    but it’s worse than the simple one,
    since it cannot even initiate connect between two side,
    the following is the sample code I use, which I leaned from here http://home.tiscali.nl/bmc88/java/sbook/029.html
    I can't found any more info regard to this topic on the internet, can you give me a hint.
    thanks a lot.
    public void listen2() throws Exception
      ServerSocket server=new ServerSocket(443, 5);
      System.out.println("Start Listen ...");
      while(true)
       Socket serverCon=server.accept();
       System.out.println("get Connection from: "+serverCon.getInetAddress());
       InputStream serverIn=serverCon.getInputStream();
       OutputStream serverOut=serverCon.getOutputStream();
       Socket targetCon=new Socket("192.168.1.1", 5900);
       InputStream targetIn=targetCon.getInputStream();
       OutputStream targetOut=targetCon.getOutputStream();
       PipedInputStream serverPin=new PipedInputStream();
       PipedOutputStream serverPout=new PipedOutputStream(serverPin);
       PipedInputStream targetPin=new PipedInputStream();
       PipedOutputStream targetPout=new PipedOutputStream(targetPin);
       while(true)
        ReadThread rt=new ReadThread("reader", targetIn, serverPout);
        ReadThread wt=new ReadThread("writer", serverPin, serverOut);
        ReadThread rt2=new ReadThread("reader", serverIn, targetPout);
        ReadThread wt2=new ReadThread("writer", targetPin, targetOut);
        rt.start();
        wt.start();
        rt2.start();
        wt2.start();
    class ReadThread extends Thread implements Runnable{
      InputStream pi=null;
      OutputStream po=null;
      String process=null;
      ReadThread(String process, InputStream pi, OutputStream po)
       this.pi=pi;
       this.po=po;
       this.process=process;
      public void run()
       byte[] buffer=new byte[1024];
       int bytes_read;
       try
        for(; ; )
         bytes_read=pi.read(buffer);
         if(bytes_read==-1)
          return;
         po.write(buffer, 0, bytes_read);
       catch(Exception e)
        e.printStackTrace();
    }

  • C# socket and java socket

    hello
    i am a java programmer,recently we got a project,that need the c# app to communicate with java app ,i select the socket as intermediate.
    i notice that java socket term is divided into " blocking" and "non-blocking",the latter come from jdk1.4, the c# socket is devided into "synchronized" and "asynchronized" and both of them are blocking,
    in my project,i have tried synchronized c# socket coorperating to blocking java socket,it works well..but when i modify the c# app to ASYNCHRONIZED socket,my system DON'T works well,i don't know why? i can't find asynchronized socket in java,.i learn that nio socket is nonblocking, is it asynchronized?
    who can tell me what's is the best solution for the socket communication between java and c#?

    yes,i have read them,but it only tell me the communication between java apps,and DON'T tell me any clue about c# socket.

  • Java Sockets - help with using objects

    I am new to java sockets, and need to come up with a way to send a user defined instance of a class across a basic client/server application.
    I can not find out how to do this. I read the tutorials, but my class can not be serialized. How can I send/recieve this instance of a user defined class?

    right off the top of my head, doesn't serialver just spit out a UID for a given set of classes?
    To mark a class as Serializable, just implement the java.io.Serializable class - then you could use the readObject/writeObject methods of the ObjectInputStream/ObjectOutputStream classes.
    Good luck
    Lee

  • Live A/V Broadcast How to support both High & Low bandwidth users ?

    Hello there
    I have been working on a requirement where I need to
    broadcast live audio and video feeds
    to Flash Media Server from where it gets broadcasted to our
    customers. We have two types of
    customers: High bandwidth and Low bandwidth.
    Now could anyone please tell me what kind of scripting is
    required at the server end so that
    the Media server broadcasts to these two level of user groups
    at same time. How do we control
    the live feeds received at the Media server ? How do I
    control the amount of bandwidth that at server
    side based on the received feed so that I can broadcast to my
    users based on their capacity ?
    I tried running two separate flash application pulling the
    feeds from SAME camera but that didn't
    work as changing the settings (like Camera.setMode..) on one
    program affects the settings on other
    program(as both programs are connected to same camera/mic). I
    do not want to buy two separate
    cameras/mic to support both high/low bandwidth users. I would
    need to do it programatically.
    Could anyone please let me know your thoughts, it would be
    very helpful to me and others.
    Many thanks,
    -Sakthik

    Thanks Charles for your reply. I didn't know that FMS doesn't
    support this feature. So you mean to say that there aren't any
    other ways to control live feeds at server side ?
    I would try your suggestion on setting the bandwidth and FPS
    at client side but I am not sure how effective will it be because
    the Server is going to push a high bandwidh data to a 56 Kbps
    pipeline. There will be lot of data loss due to this narrow
    pipeline. Do you think that applying setBandwidth and setFPS on
    this narrowed data is going to be effective ? I dont think so, what
    do you say ?
    How exactly does this setBandwidth and setFPS works ? When
    will it modify the data ? Will it modify the data after or before
    receiving it at the client end ?
    Please share your thoughts on this.
    Many thanks,
    -Sakthik

Maybe you are looking for

  • Can someone help a non-tech type with connecting AppleTV?

    I want to connect AppleTV3.  My current setup was done 6 yrs ago when I bought TV, Receiver and Speakers.  Sony TV has 3 HDMI inputs, Integra receiver has 2 HDMI inputs.  On receiver HDMI1 is from cable box, HDMI2 is Bluray, HDMI Out goes to TV HDMI1

  • IMac not Allowing Gigabit Connection

    I just realized that my 2009 iMac isn't connecting at gigabit speeds. If I let the iMac automaticlly detect the connection it connects at 100BaseTX. I have an older Macbook too, and when plugged into the same cable it detects and connects at gigabit

  • Add new line items in ISA B2B

    Hi All, My requirement is to add new line items automatically onto the shopping basket based on a main configurable line item addition. Unfortunately this could not be configured for a variety of reasons. This has to done after the user clicks on Acc

  • CUP - default roles

    Hi, We are on AC5.3, SP11. I have configured default roles in CUP. Configuration is as follows: u2022     Consider default roles: Yes u2022     Request Type: New Account u2022     Default role level: Request u2022     User attributes: System u2022   

  • Desktop Software/S​ync Problems - Help Appreciate​d

    Hello all; Forum newbie, so please forgive if covered elsewhere.  I read thru forums and did not see a similar problem. I've inherited my BB Curve from my former employer and am now trying to get in sync with my home Windows XP PC. I've downloaded th