Client/Server + oOut.writeObject(tDataToClient); ERROR

Discussion in 'Java' started by Duncan Elliot, May 17, 2013.

  1. Hi there,

    I am trying to implement the client / server example in this tutorial:

    http://en.wikibooks.org/wiki/Java_Programming/Client_Server

    It works when the server is not hosted on the same machine as the client. When both are on the same machine I get an error:

    java.net.SocketException: Connection reset by peer: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)

    I suspect there is an additional step I need to take if I wanted to test it locally, any idea??

    Thanks,

    Duncnan
    Duncan Elliot, May 17, 2013
    #1
    1. Advertising

  2. Duncan Elliot

    markspace Guest

    On 5/17/2013 6:42 AM, Duncan Elliot wrote:

    > I suspect there is an additional step I need to take if I wanted to
    > test it locally, any idea??


    Generally speaking, no. This sort of things works fine on my machine, I
    do it all the time. Check your local configuration, especially
    firewalls and virus software. Turn that stuff off for a quick check to
    see if it's interfering.

    BTW that tutorial you linked to looks a little dubious at best. Why not
    use the official one?

    <http://docs.oracle.com/javase/tutorial/networking/sockets/>
    markspace, May 17, 2013
    #2
    1. Advertising

  3. Thanks Mark - It is dubious, I cant get it to behave properly. I will give up on it.

    Cheers,

    Duncan
    Duncan Elliot, May 17, 2013
    #3
  4. Duncan Elliot

    Arne Vajhøj Guest

    On 5/17/2013 11:39 AM, markspace wrote:
    > BTW that tutorial you linked to looks a little dubious at best. Why not
    > use the official one?
    >
    > <http://docs.oracle.com/javase/tutorial/networking/sockets/>


    Good advice.

    That wikibooks example is pretty bad in many ways.

    Arne
    Arne Vajhøj, May 18, 2013
    #4
  5. On 05/17/2013 10:52 PM, Arne Vajhøj wrote:
    > On 5/17/2013 11:39 AM, markspace wrote:
    >> BTW that tutorial you linked to looks a little dubious at best. Why not
    >> use the official one?
    >>
    >> <http://docs.oracle.com/javase/tutorial/networking/sockets/>

    >
    > Good advice.
    >
    > That wikibooks example is pretty bad in many ways.
    >
    > Arne
    >

    It's atrocious. I can sort of guess what programming languages and
    operating systems the author used for this problem in the past, but I'll
    wager he had less than 6 months of Java under his belt when he wrote
    that abortion.

    I started looking at the rest of the pages there for Java, and it's
    worrisome stuff. Part of the problem is, a lot of it - maybe all of it -
    is clearly written by a guy who doesn't have an excellent command of
    English.

    But why would you even want to waste your time? Better reference
    material and tutorials on all of this have existed for 10-15 years.

    AHS
    Arved Sandstrom, May 18, 2013
    #5
  6. Duncan Elliot

    Arne Vajhøj Guest

    On 5/17/2013 10:56 PM, Arved Sandstrom wrote:
    > On 05/17/2013 10:52 PM, Arne Vajhøj wrote:
    >> On 5/17/2013 11:39 AM, markspace wrote:
    >>> BTW that tutorial you linked to looks a little dubious at best. Why not
    >>> use the official one?
    >>>
    >>> <http://docs.oracle.com/javase/tutorial/networking/sockets/>

    >>
    >> Good advice.
    >>
    >> That wikibooks example is pretty bad in many ways.
    >>

    > It's atrocious. I can sort of guess what programming languages and
    > operating systems the author used for this problem in the past,


    You were also thinking Windows and C++?

    :)

    > but I'll
    > wager he had less than 6 months of Java under his belt when he wrote
    > that abortion.
    >
    > I started looking at the rest of the pages there for Java, and it's
    > worrisome stuff. Part of the problem is, a lot of it - maybe all of it -
    > is clearly written by a guy who doesn't have an excellent command of
    > English.
    >
    > But why would you even want to waste your time? Better reference
    > material and tutorials on all of this have existed for 10-15 years.


    The good thing about the internet is that is that everybody can
    post what they want. The bad thing about internet is that everybody
    can post what they want.

    :)

    Arne
    Arne Vajhøj, May 18, 2013
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kaidi
    Replies:
    4
    Views:
    2,339
    Kaidi
    Jan 3, 2004
  2. Kaidi
    Replies:
    7
    Views:
    4,355
    Robert Olofsson
    Jan 6, 2004
  3. JMC
    Replies:
    1
    Views:
    770
    Roedy Green
    Apr 7, 2004
  4. jprogrammer
    Replies:
    10
    Views:
    5,016
    Tony Morris
    Apr 22, 2004
  5. Roedy Green

    writeObject signature

    Roedy Green, Jun 8, 2004, in forum: Java
    Replies:
    35
    Views:
    1,263
    Dale King
    Apr 15, 2006
Loading...

Share This Page