client on Linux and Server on Windows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ganeshp
    New Member
    • May 2007
    • 38

    client on Linux and Server on Windows

    Hi ,

    In Java using socket programming is it possible to have a server program on windows that services a client program on linux?

    I tried the code in the below given link:
    http://williams.comp.n cat.edu/Networks/JavaSocketExamp le.htm

    This does not work when the client program is on a Linux machine.
    Error:
    Error Connection refused
    java.net.Connec tException: Connection refused
    at java.net.PlainS ocketImpl.socke tConnect(Native Method)
    at java.net.PlainS ocketImpl.doCon nect(PlainSocke tImpl.java:333)
    at java.net.PlainS ocketImpl.conne ctToAddress(Pla inSocketImpl.ja va:195)
    at java.net.PlainS ocketImpl.conne ct(PlainSocketI mpl.java:182)
    at java.net.SocksS ocketImpl.conne ct(SocksSocketI mpl.java:366)
    at java.net.Socket .connect(Socket .java:516)
    at java.net.Socket .connect(Socket .java:466)
    at java.net.Socket .<init>(Socket. java:366)
    at java.net.Socket .<init>(Socket. java:179)
    at Tclient.main(Tc lient.java:31)

    Can anyone tell me how to make this server on Windows communicate with the client on Linux?
  • Nepomuk
    Recognized Expert Specialist
    • Aug 2007
    • 3111

    #2
    Originally posted by ganeshp
    Hi ,

    In Java using socket programming is it possible to have a server program on windows that services a client program on linux?

    I tried the code in the below given link:
    http://williams.comp.n cat.edu/Networks/JavaSocketExamp le.htm

    This does not work when the client program is on a Linux machine.
    Error:
    Error Connection refused
    java.net.Connec tException: Connection refused
    at java.net.PlainS ocketImpl.socke tConnect(Native Method)
    at java.net.PlainS ocketImpl.doCon nect(PlainSocke tImpl.java:333)
    at java.net.PlainS ocketImpl.conne ctToAddress(Pla inSocketImpl.ja va:195)
    at java.net.PlainS ocketImpl.conne ct(PlainSocketI mpl.java:182)
    at java.net.SocksS ocketImpl.conne ct(SocksSocketI mpl.java:366)
    at java.net.Socket .connect(Socket .java:516)
    at java.net.Socket .connect(Socket .java:466)
    at java.net.Socket .<init>(Socket. java:366)
    at java.net.Socket .<init>(Socket. java:179)
    at Tclient.main(Tc lient.java:31)

    Can anyone tell me how to make this server on Windows communicate with the client on Linux?
    As Java is platform independent, the communication shouldn't be a problem. I guess, either something is wrong in the code or, more likely, you made a mistake when running it. Did you start the TServer first? Is port 3456 opened on the server?

    Greetings,
    Nepomuk

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by ganeshp
      Hi ,

      In Java using socket programming is it possible to have a server program on windows that services a client program on linux?

      I tried the code in the below given link:
      http://williams.comp.n cat.edu/Networks/JavaSocketExamp le.htm

      This does not work when the client program is on a Linux machine.
      Error:
      Error Connection refused
      java.net.Connec tException: Connection refused
      at java.net.PlainS ocketImpl.socke tConnect(Native Method)
      at java.net.PlainS ocketImpl.doCon nect(PlainSocke tImpl.java:333)
      at java.net.PlainS ocketImpl.conne ctToAddress(Pla inSocketImpl.ja va:195)
      at java.net.PlainS ocketImpl.conne ct(PlainSocketI mpl.java:182)
      at java.net.SocksS ocketImpl.conne ct(SocksSocketI mpl.java:366)
      at java.net.Socket .connect(Socket .java:516)
      at java.net.Socket .connect(Socket .java:466)
      at java.net.Socket .<init>(Socket. java:366)
      at java.net.Socket .<init>(Socket. java:179)
      at Tclient.main(Tc lient.java:31)

      Can anyone tell me how to make this server on Windows communicate with the client on Linux?
      Connection refused is a security problem. Can you ping/telnet the computer you are trying to access. Perhaps you need an Aunthenticator to access that computer.

      Comment

      • ganeshp
        New Member
        • May 2007
        • 38

        #4
        Originally posted by nepomuk
        As Java is platform independent, the communication shouldn't be a problem. I guess, either something is wrong in the code or, more likely, you made a mistake when running it. Did you start the TServer first? Is port 3456 opened on the server?

        Greetings,
        Nepomuk
        Yes i started the server first on windows.
        I think port 3456 is opened because server did not give any errors

        Comment

        • ganeshp
          New Member
          • May 2007
          • 38

          #5
          Originally posted by r035198x
          Connection refused is a security problem. Can you ping/telnet the computer you are trying to access. Perhaps you need an Aunthenticator to access that computer.

          Yes i was able to ping the windows server successfully from the linux machine

          Comment

          • ganeshp
            New Member
            • May 2007
            • 38

            #6
            hi all,
            The program is working now,
            The ip address of the server that i had mentioned in the client program was wrong.

            Thanks for your comments.
            regards,
            Ganesh

            Comment

            Working...