Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Sockets,Streams and Threads
Sockets,Streams and Threads [message #514856] Tue, 16 February 2010 16:16 Go to next message
Eclipse UserFriend
How can I synchronized Object streams in more than one threads?
Re: Sockets,Streams and Threads [message #514886 is a reply to message #514856] Tue, 16 February 2010 19:39 Go to previous messageGo to next message
Eclipse UserFriend
Jordan Borisov wrote:
> How can I synchronized Object streams in more than one threads?
That is a very general question. Could you provide more details about
what you are trying to do and how it relates to Eclipse?
Re: Sockets,Streams and Threads [message #515478 is a reply to message #514886] Thu, 18 February 2010 16:34 Go to previous message
Eclipse UserFriend
In my program I use sockets. The client communicate with the server with messages and also send object to another socket bind to the server. Every client run in separate thread and waiting in the run method for a message. Depending on the message type the server send different result. This is the reason why I want to synchronized the stream, because the ObjectInputStream constructor throws exception "Invalid header".
Anyway I found a solution. Now the server and the client communicate only with serializable object. The program run exactly as it should. Unfortunately I haven't understand how to synchronized sockets stream in separate threads.
Re: Sockets,Streams and Threads [message #515497 is a reply to message #515478] Thu, 18 February 2010 16:06 Go to previous message
Eclipse UserFriend
Jordan Borisov wrote:
> In my program I use sockets. The client communicate with the server with
> messages and also send object to another socket bind to the server.
> Every client run in separate thread and waiting in the run method for a
> message. Depending on the message type the server send different result.
> This is the reason why I want to synchronized the stream, because the
> ObjectInputStream constructor throws exception "Invalid header".
> Anyway I found a solution. Now the server and the client communicate
> only with serializable object. The program run exactly as it should.
> Unfortunately I haven't understand how to synchronized sockets stream in
> separate threads.

This sounds like a general Java issue, not an Eclipse specific issue.
You will probably find more help on a Java specific newsgroup or from a
book about concurrent Java programming. I would suggest the "Concurrent
Programming in Java" book by Doug Lea.
Previous Topic:How to give a user feedback during a Tracker drag
Next Topic:coordinate system
Goto Forum:
  


Current Time: Tue Jul 08 16:11:24 EDT 2025

Powered by FUDForum. Page generated in 0.04202 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top