Socker Error using simple app

Hello All
I have a simple app that consists of a client and server. This works fine when both components are on the same network (either on the same machine or two different machines), however I get the following error when the client and server are on different networks:
java.net.SocketException Unrecognized Windows Sockets Error :10071
Some strange things:
1) If I reverse the client & server, the app works (ie if the client is on network 1 and the server on network 2, the app fails but if the client is on network 2 and server on network 1, it's ok)
2) The above error appears to be an NFS error - both machines are Windows
3) My network administrator says there are no problems with the firewall and this should work ok.
Thanks for any help
Chris

The problem actually raised itself in an rmi app, so I thought I'd just write the following test code to eliminate the rmi layer. As you can see, it's all simple stuff:
Server Code:
import java.io.*;
import java.net.*;
public class TestServer
  public static void main(String[] args)
    int port = 1099;
    if (args.length > 0)
      try
        port = Integer.parseInt(args[0]);
      catch (NumberFormatException e)
        e.printStackTrace();
        System.exit(0);
    try
      ServerSocket s = new ServerSocket(port);
      while (true)
        new MessageDumper(s.accept()).run();
    catch (Exception e)
      e.printStackTrace();
  static class MessageDumper implements Runnable
    public MessageDumper(Socket s)
      this.s = s;
    public void run()
      try
        BufferedReader br = new BufferedReader(new InputStreamReader(s.getInputStream()));
        String str = br.readLine();
        System.out.println(s.getInetAddress().getHostName() + " says " + str);
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(s.getOutputStream())));
        pw.println("GoodBye");
        pw.flush();
        pw.close();
        br.close();
        s.close();
      catch (Exception e)
        e.printStackTrace();
    Socket s;
Client Code:
import java.io.*;
import java.net.*;
public class TestClient
  public static void main(String[] args)
    int port = 1099;
    String host = "localhost";
    // arg 0 is host, arg 1 is port
    switch (args.length)
    case 2:
      try
        port = Integer.parseInt(args[1]);
      catch (NumberFormatException e)
        e.printStackTrace();
    case 1:
      host = args[0];
    try
      Socket s = new Socket(host, port);
      PrintWriter pw = new PrintWriter(new OutputStreamWriter(new BufferedOutputStream(s.getOutputStream())));
      pw.println("Hello");
      pw.flush();
      BufferedReader br = new BufferedReader(new InputStreamReader(s.getInputStream()));
      String str = br.readLine();
      System.out.println(str);
      br.close();
      pw.close();
      s.close();
    catch (Exception e)
      e.printStackTrace();
}

Similar Messages

  • Network error using Facebook app?

    I am getting a network error message when using the Facebook app.  What can I do?

    make sure you are connected to wi fi.
    go to settings>airplane mode>turn it on, then back off.
    try using facebook app again

  • Hi, i'm new using numbers, and when I try to open a excel file don't let me do it, instead appears a box whit a error and close app,  any help?

    Hi, i'm new using numbers, and when I try to open a excel file don't let me do it, instead appears a box whit a error and close app,  any help?

    What does the error say?
    A couple of thoughts: the file is corrupted or is password-protected. Corruption is more likely to cause Numbers to crash & Numbers cannot open password-protected Excel files. Try using one of the free Office clones & see what happens.

  • When I use my Apple ID for the last 12 hours I get this response:  "There was an error in the App Store. Please try again later. (4)".   How do I get around this?  Try two apple ID's.  Same thing.

    When I use my Apple ID for the last 12 hours I get this response:  "There was an error in the App Store. Please try again later. (4)".   How do I get around this?  Try two apple ID's.  Same thing. 

    What does it mean when I get...: Apple Support Communities
    'there was an error in the App Store....: Apple Support Communities

  • How to create a simple app using the MVC approach?

    Hello gurus i'm trying to learn the SAPUI5 and i'm trying to create a simple app using the MVC i created the app and trying to add a lable to the view but there is nothing appear when i run it the code for the HTML page
    <!DOCTYPE HTML>
    <html>
      <head>
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
      <script src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
      id="sap-ui-bootstrap"
      data-sap-ui-libs="sap.m"
      data-sap-ui-theme="sap_bluecrystal">
      </script>
      <!-- only load the mobile lib "sap.m" and the "sap_mvi" theme -->
      <script>
      sap.ui.localResources("mytestapp");
      var view = sap.ui.view({id:"idshell1", viewName:"mytestapp.shell", type:sap.ui.core.mvc.ViewType.JS});
      view.placeAt("content");
      </script>
      </head>
      <body class="sapUiBody" role="application">
      <div id="content"></div>
      </body>
    </html>
    the code for the view
    sap.ui.jsview("mytestapp.shell", {
      /** Specifies the Controller belonging to this View.
      * In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.
      * @memberOf mytestapp.shell
      getControllerName : function() {
      return "mytestapp.shell";
      /** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.
      * Since the Controller is given to this method, its event handlers can be attached right away.
      * @memberOf mytestapp.shell
      createContent : function(oController) {
      var oLabel = new sap.ui.commons.Label("l1");
      oLabel.setText("Test label");
      oLabel.placeAt("content");
    i dont know what is wrong or if i should use a container to display my controls
    any help will be appreciated
    thanks in advance

    Hi,
    Instead of   oLabel.placeAt("content"); use return oLabel;
    so it will as below,
    createContent : function(oController) {
      var oLabel = new sap.ui.commons.Label("l1");
      oLabel.setText("Test label");
      return oLable;
    Regards,
    Chandra

  • I can no longer open excel documents in my doc to go app. Error message simple reads can not open attachment. And the attachment is now a winmail.dat

    I can no longer open excel documents in my doc to go app. Error message simple reads can not open attachment. And the attachment is now a winmail.dat

    winmail.dat files usually mean the email has been sent in rich text format - you could either the person who sent it to send it in a different format e.g. plain text or HTML, or there are a few apps in the store that support it (search for winmail.date in the store).
    winmail.dat files : http://support.apple.com/kb/TS1506

  • How to solve this error 'This package is using an app name that hasn't been reserved for this app: "Matest"

    i already reserved app name as Ma_Test. But only one error showing "This package is using an app name that hasn't been reserved for this app: "Matest". how to solve?

    Hello,
    You need to make sure both names match exactly

  • Capturing error messages from Oracle EBS APIs when using Oracle Apps Adapter

    We are using Oracle applications adapter to call Oracle EBS (both R11.5 and R12) APIs. I want to understand the best practice around error handling when using Oracle Apps Adapter to call Oracle EBS.
    Here are some observations:
    1. Most of the APIs return X_RETURN_STATUS and X_MSG_DATA containing the status and messages if any.
    2. If the MSG COUNT is 1 then X_MSG_DATA contains the message, if MSG COUNT is > 1. X_MSG_DATA is empty.
    We know that when calling the API directly from PL/SQL, we need to loop through FND_MSG_PUB to fetch all messages when there are more than 1. How do we achieve the same using Apps Adapter as Apps Adapter generates the PL/SQL block to call the API dynamically at runtime.
    In some APIs, which have table/rec types as input or output parameters, Apps Adapter generates a wrapper package to do conversion from SQL--> PL/SQL and viceversa. In this case the adapter calls the custom package generated which internally calls the API. For these APIs we were able to put the logic to loop through FND_MSG_PUB and return a concatenated string as value of X_MSG_DATA.
    But what should we do for the APIs which do NOT have a rec/table type as input or output, in which case the Apps Adapter directly calls the API and there is no intermediate custom package?
    How are others handling this?

    Please see the section "Handling Functional Errors" in the below link
    Oracle Fusion Middleware Adapter for Oracle Applications User's Guide

  • Duplicate session error using Flash Remoting from Air 3.4 Mobile Apps ( IOS and Android ) with CF10

    We're getting the "duplicate session" error using Flash Remoting from Air 3.4 Mobile Apps ( IOS and Android ) with Coldfusion 10 Standard.
    faultCode:Server.Processing.DuplicateSessionDetected faultString:'Detected duplicate HTTP-based FlexSessions,
    generally due to the remote host disabling session cookies.
    Session cookies must be enabled to manage the client connection correctly.' faultDetail:'null'
    Have read most of the docs about this error -all to do with LCDS
    Notes:
    Not using LCDS,
    No Remote Calls from loaded Sub-Apps,
    No Errors from the Flex Web App which is pretty  much identical and calls the same cfcs.
    The error does not happen all the time and is hard to reproduce - say 5% of app sessions at a guess.
    Could it be a two first time remote calls hitting the server together before a session is set up?
    Our remoteObjects are in two places 1) Main Application.mxml and within a class compiled into the main app - can't see how this would be an issue.
    I enabled session management for the CFCs in Application.cfc but still occurs. Is this neccessary - it's not in any docs?
    Could this be something to do with the app not being shut down - as is typical with mobile users? When they resume use after a day or two surely a new session will be created?
    Please advise thank you.

    For our profect I think this issue was caused as follows:
    Believing that remoting was full asynchronous we fired a 2 or 3 remote calls to the server at the same time ( within the same function ) - usually when the users goes to a new section of the app.
    This seemed to trigger the duplicate http session error since according to http://blogs.adobe.com/lin/2011/05/duplication-session-error.html  two remote calls arriving before a session is created will cause 2 sessions to be created.
    Our current solution ( too early to say it works ) is to daisy chain the multiple calls together .
    Also there seemed to be an issue where mobile apps that never quit ( thanks Apple! )  caused the error when activated after a few hours.
    I guess the session expires on the server and the error above occurs on activation.
    So the mobile apps now ping the server with a remote call when activated after sleeping for more than one hour.
    All duplicate http errors are silently caught and reported.
    Fingers crossed we won't get any more!

  • TS1702 unknown error when using the app store

    unknown error when using the app store

    Im sorry I will try to be more clear.. and I appreciate all of ur input. Wi-fi works fine.. everything opens and functions fine on the I pad. The problem is I will click on app store or the I tunes store...it opens fine and I am able to look at and download apps  etc... but after being in the appstore or I tunes store for a couple of minutes I get kicked out to the I pads home screen. Its like pushing the home button but I didn't. It only seems to do this when im in the app store or I tunes store. I have been using the chrome browser and other downloaded apps such as ebay just fine with out this problem occurring. Not sure about safari as I dont use it and use chrome instead. Um I don't think the home button its self is faulty because it works fine and as stated before this only happens when I am in the appstore or I tunes . I've only had this I pad 1 64gb wi-fi for a few days .. I got it off of ebay it was stuck in restore mode getting error code 1611.  I was able to successfully Restore it with I tunes and it running ios 5.1. Seams to work great besides the problem being mentioned.

  • I am using windows 8 pro in my laptop, when i try to install icloud 3.1 its giving me a error message " this app cant be run , check the version " what should i do now ?

    i am using windows 8 pro in my laptop, when i try to install icloud 3.1 its giving me a error message " this app cant be run , check the version " what should i do now ?

    Many thanks.
    With those symptoms, I'd try the following document:
    Apple software on Windows: May see performance issues and blank iTunes Store
    (If there's a SpeedBit LSP showing up in Autoruns, it's usually best to just uninstall your SpeedBit Video Accelerator.)

  • Error while adding items to cart using oracle.apps.ibe.shoppingcart.list.ShopList.saveQuoteFromListLines API

    Hello,
    I am getting the below error message when I try to add line items to cart using oracle.apps.ibe.shoppingcart.list.ShopList.saveQuoteFromListLines API.
    ORA-01403: no data found in Package IBE_Shop_List_PVT Procedure Save_Quote_From_List_Items
    This is the underlying procedure/package getting called:  IBE_Shop_List_Wrapper_PVT.Save_Quote_From_List_Items
    Please help me in resolving this issue.
    Thanks in advance!

    L S P.. wrote:
    Hi,
    Actually that notes says about invalid objects in ASO and IBE objects.
    But i couldn't found any invalid objects. Also i was cleared cache using functional administrator also.
    But still am getting this error.
    Please help on this.. It is on critical.Please log a SR if the doc did not help.
    Thanks,
    Hussein

  • I've transferred. Some photos in my iPhone 4s using the app ''simple transfer'' but I can't find the option to delete those photos from iPhone, if any body knows let me know please??

    I've tranferred some photos in my iPhone 4s using the app called simple transfer lite, but still can't find any option to delete those photos, if any body knows how to do this please let me know.

    I have a suggestion, noted below,  but I'd like a little more information please.  Are you saying that after you've transfered photos to your PC or Mac you want to then delete them from the iPhone?  If they're photos taken with the iPhone couldn't you just go back into Camera roll and delete them there?
    I had a similar situation with my parent's iPhone and iPad.  I synced a couple of folders of photos via iTunes on their laptop to the iPad.  The intent was to use the slideshow feature on the iPad as a digital photo frame.  To save time, I had synced all the photos in the folders, thinking that my mom could delete the pics she didn't want.  After doing this I found I couldn't delete any of the pictures synced this way.  I came to find out that pictures contained in folders synced via iTunes cannot be deleted from the iOS device.
    A friend suggested a paid app called PhotoSync.  It's $1.99 and no, I have absolutely no connection to the deveolper.  It's just an app that does exactly what I needed it to do.  After transfering photos you can go into camera roll or an album and delete them.  There is a companion free app that you install on your PC or Mac that makes the transfers very easy.
    I have less than 15 apps on my iPhone.  I generally like free apps but, as I've said, I found this app does what I needed to do so I was happy to spend the money.
    Good luck.

  • My back up is not encrypted but when I use an app to export my SMS, I get an error saying that the back up is encrypted

    In iTunes, my back up is not encrypted (the box isn't checked). But when I use an app to export my SMS, it sends me an error message saying 'Your iPhone backup is encrypted. Open iTunes and disable the "Encrypt iPhone Backup" option'. But I do not have my back up encrypted!!! This is maddening! What do I do?

    If I am guessing that app correctly, then install the latest s/w version 1.5.9.
    Was at 1.4.3 previously and faced the same issue as yourself when I upgraded to iOS 5.0.1. Solved it by grabbing the latest sms export s/w.

  • I cannot get my apps to sync.  This happened with a previous iPhone 3gs.  I think it had something to do with error message 6.  Could there be some settings on my computer that are causing the conflict?  I WANT to use my apps!!

    I can't get my apps to sync on my new iPhone 3gs.  This happened on a previous iPhone and never was resolved.  Could there be a conflict with some settings on my computer?  I want to use my apps!!!

    Click 6 here >  iOS: Resolving update and restore alert messages
    Could be your security software preventing the sync to finish.

Maybe you are looking for

  • BluStreak 2, is it useful for Encore users?

    Pressing 'Reply' sends your message to the entire DVDList. To reply to the author only, you must enter their address manually. Rivergate Software is pleased to announce the beta release of BluStreak Premaster 2, soon to be followed by the formal rele

  • 20 minute battery life

    I have a 15 inch powerbook G4 1.5 Ghz, with 512 MB of RAM. It was purchased a little less than a year and a half ago. The battery life on it was never very good (maxing out at about an hour and thirty minutes), but recently it's taking a turn for the

  • How to get default settings

    I bought a new lumix camera. to play video I had to download quicktime on a provided disk. the first time I did it it gave me an option to make quicktime my default program which it did . It took over my picture files which I didn't like so I uninsta

  • How do you monitor your systems?

    I'd like to be able to monitor my Ironport systems to be able to see * SMTP up/down on each interface * active recipient queue size * CPU/RAM/Disk use (as a %) * number of connections in last 5 minutes * ...In fact some of the data from the system st

  • Assigning of authorization object to authorization group

    I have created an authorization object and I have assigned this to already exsiting authorization group.I would like to assign the authorization object to a new  authorization group.Please confirm how to create an authorizaton group and assigning a a