Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: ObjectOutputStream more than one on same socket

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Location
    Salt Lake City, Utah
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default ObjectOutputStream more than one on same socket

    I'm still new to sockets so bare with me, here is what I'm trying to do. I have socket that sends an image constantly to a client (details in "sending images client/server sockets") but I also need to send and receive changes to the camera pan/tilt and zoom when it changes. First however, I'm trying to send the preset camera PTZ to the client for the GUI to set the existing PTZ on the camera control screen I create. Can I use the same socket and object output or do I need to create a new one?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: ObjectOutputStream more than one on same socket

    Are you asking if you can interleave output on the one output stream?
    Can the reader use instanceOf to detect what kind of object it has read?

    Seems like a separate communication socket would simplify the app.

  3. #3
    Junior Member
    Join Date
    Jun 2011
    Location
    Salt Lake City, Utah
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: ObjectOutputStream more than one on same socket

    I'll try instance of thanks. That just means having the web service data read seperatly before I create the output stream and then checking if it's an instance of an ImageIO probably.

Similar Threads

  1. Socket Threads
    By jtseaman85 in forum Threads
    Replies: 2
    Last Post: September 15th, 2011, 12:24 AM
  2. Socket problem
    By Robtn in forum What's Wrong With My Code?
    Replies: 11
    Last Post: June 15th, 2011, 03:50 PM
  3. Socket Programming and GUI
    By oyunmax in forum Java Networking
    Replies: 3
    Last Post: June 15th, 2011, 03:01 PM
  4. Need help with client socket
    By Robtn in forum Java Theory & Questions
    Replies: 2
    Last Post: May 23rd, 2011, 02:26 PM
  5. Socket C
    By ighor10 in forum Java Networking
    Replies: 0
    Last Post: June 22nd, 2010, 06:56 AM