Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Sockets,Streams and Threads
Sockets,Streams and Threads [message #514856] Tue, 16 February 2010 21:16 Go to next message
Jordan Borisov is currently offline Jordan Borisov
Messages: 9
Registered: July 2009
Junior Member
How can I synchronized Object streams in more than one threads?
Re: Sockets,Streams and Threads [message #514886 is a reply to message #514856] Wed, 17 February 2010 00:39 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1341
Registered: July 2009
Senior Member
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 21:34 Go to previous message
Jordan Borisov is currently offline Jordan Borisov
Messages: 9
Registered: July 2009
Junior Member
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 21:06 Go to previous message
David Wegener is currently offline David Wegener
Messages: 1341
Registered: July 2009
Senior Member
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: Thu Oct 02 16:39:56 GMT 2014

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

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