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

D

Duncan Elliot

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
 
M

markspace

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/>
 
D

Duncan Elliot

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

Cheers,

Duncan
 
A

Arved Sandstrom

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
 
A

Arne Vajhøj

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top