Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

11 views
Skip to first unread message

Duncan Elliot

unread,
May 17, 2013, 9:42:36 AM5/17/13
to
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

markspace

unread,
May 17, 2013, 11:39:07 AM5/17/13
to
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/>

Duncan Elliot

unread,
May 17, 2013, 1:04:06 PM5/17/13
to
Thanks Mark - It is dubious, I cant get it to behave properly. I will give up on it.

Cheers,

Duncan

Arne Vajhøj

unread,
May 17, 2013, 9:52:36 PM5/17/13
to
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

Arved Sandstrom

unread,
May 17, 2013, 10:56:07 PM5/17/13
to
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

Arne Vajhøj

unread,
May 18, 2013, 8:44:37 AM5/18/13
to
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


0 new messages