Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Some networking thoughts  RSS feed

Rob van Oostveen
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm well on my way with the URLyBird 1.2.1 assignment. But I have some thoughts I'd like to share with you regarding the networking part.

When I start the server thread, which will listen on tcp/4433, it blocks on the accept() method. Which is fine. Whenever a new connection comes in, the server thread starts a new thread for the new socket.

I might consider handling the following side-effects, like:

What if the client suddenly stops working? Hardware failure, network failure, .. I have the locking covered within the server class. My main concern is the way the server thread, handling the client, can potentially wait forever for client requests.
I'm thinking of implementing some sort of 'hello' protocol, but is this really necessary for the assignment?

How have you handled this?

Thanks for sharing your thoughts

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!