BufferedImage over socket need help

I have written a program that gets frames from my webcam and can save it to my hdd as jpg files, which works fine. I would now like to send the bufferedimages from my server to connected clients instead of saving them to my hdd. I've searched for help on the forums but can't find anything that works. If you have any ideas or code snipets on how to send the bufferedimages and receive them it would be appreciated. Thanks.

Just send them as regular files.If you can write your images to a temp file, send them as such:
     in = new BufferedInputStream( new FileInputStream(file));
     out = new BufferedOutputStream( socket.getOutputStream());
And receive it on the server side as such:
BufferedInputStream in = new BufferedInputStream( clientSocket.getInputStream() );
     BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream(file) );
//write it to the client's hdd
Once you send your file out, just delete your temp file.
I hope this will help.

Similar Messages

  • 802.1x EAP-PEAP over Ethernet need help !!!

    I am trying to get wired 802.1x EAP-PEAP to work and after spending about 8 hours
    troubleshooting this, I am not sure what else to do.  Need help.  Here
    is the scenario:
    - Cisco Catalyst 3350 switch running IOS versionc3550-ipservicesk9-mz.122-44.SE6.bin,
    - Steelbelted/JUniper Radius Server version 6.1.6 on a windows 2003 server
    with IP address of 129.174.2.7.  This device is connected to the same switch above.
    Firewall is OFF on the server, allow ALL,
    - Windows 2003 Enterprise Server supplicant with the latest Service pack and patches.  Again,
    Firewall is OFF on the server, allow ALL.  Juniper has verified the configuration settings
    on the Supplicant machine.  The supplicant has a static IP address of 129.174.2.15, same subnet
    as the radius server, I just want enable EAP-PEAP so that user is forced to authenticate before
    the port is activate to be "hot".
    - Juniper TAC has verified the configuration on the Steelbelted radius for eap-peap
    and that everything is looking fine,
    I have verified that the switch can communicate fine with the radius server.
    - Configuration on the switch for 802.1x:
    aaa new-model
    aaa authentication dot1x default group radius
    radius-server host 129.174.2.7 auth-port 1812 acct-port 1813 key 123456
    interface FastEthernet0/39
      description windows 2003 Supplicant
      switchport access vlan 401
      switchport mode access
      dot1x port-control auto
      no spanning-tree portfast (does not matter if this is enable or disable)
    lab-sw-1#
    .May 20 07:52:47.334: dot1x-packet:Received an EAP request packet from EAP for mac 0000.0000.0000
    .May 20 07:52:47.338: dot1x-packet:dot1x_mgr_send_eapol :EAP code: 0x1  id: 0x2  length: 0x0005 type: 0x1  data:
    .May 20 07:52:47.338: EAPOL pak dump Tx
    .May 20 07:52:47.338: EAPOL Version: 0x2  type: 0x0  length: 0x0005
    .May 20 07:52:47.338: EAP code: 0x1  id: 0x2  length: 0x0005 type: 0x1
    .May 20 07:52:47.338: dot1x-packet:dot1x_txReq: EAPOL packet sent out for the default authenticator
    lab-sw-1#
    lab-sw-1#sh dot1x interface f0/39
    Dot1x Info for FastEthernet0/39
    PAE                       = AUTHENTICATOR
    PortControl               = AUTO
    ControlDirection          = Both
    HostMode                  = SINGLE_HOST
    Violation Mode            = PROTECT
    ReAuthentication          = Disabled
    QuietPeriod               = 60
    ServerTimeout             = 30
    SuppTimeout               = 30
    ReAuthPeriod              = 3600 (Locally configured)
    ReAuthMax                 = 2
    MaxReq                    = 2
    TxPeriod                  = 30
    RateLimitPeriod           = 0
    lab-sw-1#
    I am at a complete lost here.  don't know what else to do.  Someone with expertise in this realm please
    help me how to make this work.
    Many thanks in advance,

    #1:  dot1x system-auth-control is already in the switch configuration
    #2:  Not sure if you're already aware, the minute I entered "dot1x port-control auto", the command "dot1x pae authenticator" automatically appears on the interface configuration
    The case is being worked on by Cisco TAC.  One of the issues is the windows 2003 server supplicant refuses to work.  Windows XP supplicant uses machine-authentication instead of user-authentication.  Cisco TAC is looking into this issue.

  • Sending object over socket - please help (urgent)

    I have written a server/client application where server sends object to client.
    But on the client I've received the first message "@Line 1: Get ready!!!" TWICE but NEVER the second message "@Line 2: Please input Start".
    Please help me! Its urgent! I appreciate my much in advance.
    The source for Server:
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import sendNode;
    public class TestSer {
         static sendNode sendNodeObj = new sendNode();
    static String inputLine;
         public static void main(String[] args) throws IOException {
    ServerSocket serverSocket = null;
    try {
    serverSocket = new ServerSocket(4444);
    } catch (IOException e) {
    System.err.println("Could not listen on port: 4444.");
    System.exit(1);
    Socket clientSocket = null;
    try {
    clientSocket = serverSocket.accept();
    } catch (IOException e) {
    System.err.println("Accept failed.");
    System.exit(1);
    OutputStream o = clientSocket.getOutputStream();
    ObjectOutput out=new ObjectOutputStream(o);
    BufferedReader in = new BufferedReader(
                        new InputStreamReader(
                        clientSocket.getInputStream()));
    sendNodeObj.sendMsg="@Line 1: Get ready!!!";
    sendNodeObj.typeNode=-1;
    out.writeObject(sendNodeObj);
    out.flush();
    sendNodeObj.sendMsg="@Line 2: Please input Start";
    sendNodeObj.typeNode=-2;
    out.writeObject(sendNodeObj);
    out.flush();
    inputLine = in.readLine();
    while (!inputLine.equalsIgnoreCase("Start")) {
         sendNodeObj.sendMsg="@Error, Please input Start";
    sendNodeObj.typeNode=-1;
    out.writeObject(sendNodeObj);
    out.flush();
    inputLine = in.readLine();
    out.close();
    in.close();
    clientSocket.close();
    serverSocket.close();
    The source code for Client :
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.applet.Applet;
    import sendNode;
    public class TestCli extends Applet {
    static sendNode recNodeObj=null;
    public static void main(String[] args) throws IOException {
    BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
    Socket kkSocket = null;
    PrintWriter out = null;
    try {
    kkSocket = new Socket("127.0.0.1", 4444);
    out = new PrintWriter(kkSocket.getOutputStream(), true);
    } catch (UnknownHostException e) {
    System.err.println("Don't know about host.");
    System.exit(1);
    } catch (IOException e) {
    System.err.println("Couldn't get I/O for the connection to: taranis.");
    System.exit(1);
    InputStream i= kkSocket.getInputStream();
    ObjectInput in= new ObjectInputStream(i);
    try {
         recNodeObj = (sendNode)in.readObject();
    System.out.println(recNodeObj.sendMsg);
         recNodeObj = (sendNode)in.readObject();
    System.out.println(recNodeObj.sendMsg);
    if (recNodeObj.sendMsg.equalsIgnoreCase("@Line 2: Please input Start")) {
    out.println("Start");
    } catch (Exception e) {
    System.out.println(e.getMessage());
    System.out.println("receive error.");
    System.exit(1);
    out.close();
    in.close();
    stdIn.close();
    kkSocket.close();
    The object to be sent:
    import java.io.*;
    import java.net.*;
    import java.util.*;
    class sendNode implements Serializable {
    String sendMsg;
    int typeNode; // -1 no ObjectNode;
    // 1 right node, 2 base node, 3 left node;
    Object objectNode;

    You forgot to reset the OOS. ObjetOutputStream keeps a buffer of objects, so if you write the same object again with changes on it, you must reset the buffer.
    out.writeObject(sendNodeObj);
    out.flush();
    out.reset();

  • HT201412 My ipod screen is black with white and gray lines all over; i need help please!My ipod also won't respond to any button pressing and nothing shows/syncs on itunes

    I was using my ipod when the screen froze,then it went black/gray with messedup pixels and lines everywhere.I already tried plugging it in and connecting it to my computer,but nothings shows up in itunes, and my ipod doesn't respond to any buttons.Plus it won't go off.Someone please help; i don't want to have to replace it.

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • Need help wrt query

    Hi ,
    I have table A with below data :
    Name Sal
    Ram

    That's because it's over here:
    Need help wrt query

  • Having serious problems withe my ipod touch 1st gen need help!!

    just last week it was working fine then within a span of 2 hrs the wifi just wouldnt connnect any more. no matter what i did in reseting the the ipod or setting it wouldnt work. then it battery life just started to go only watched 20 min of a movie and the batter died. and yesterday i lastened to 8 hrs of music then it died. and now today only was able to listen to 1 hr of music then it died. all were charged over night. need help please!!!

    WiFi problems, especially if you have lost the WiFi symbol from the top left of the screen, can usually be fixed by resetting network settings - Settings > General > Reset > Reset Network Settings.
    For your other problems, I think a complete restore might be in order. I would at least try it and see what happens.

  • Need help using LabVIEW 7.1 and data socket to transfer images

    I need help transferring images across a company network using: LV 7.1, IMAQ 3.0 and a PCI 1407 image aquisition card. I am trying to use datasocket to transfer video image across a company network. I have attached sample vis. Thanks in advance for your help.
    I. Cyr
    Attachments:
    Vibration Chamber Vision_Cyr.llb ‏129 KB

    Hello –
    Something that you need to consider is the fact that when you are sending an image over Data Socket, it is not really the image what is being transferred but a pointer to the image. Please take a look into this Knowledgebase.
    Also, you might find this Example Program useful.
    Hope this helps.
    S Vences
    Applications Engineer
    National Instruments

  • Need help on Socket and HTTP

    Hi,
    I need help ... please ... I have to use socket and not HTTPURLConnection
    I try to connect with a socket to a web server (apache2) and request one page but two times.
    The first time it works well but the second one it doesn't ... I get a null message.
    Why ?
    Does the server close the socket as soon as the page is sent ?
    If it doesn't how I can continue sending and receiving data on the same socket ?
    Here is my code:
    package test;
    import java.net.*;
    import java.io.*;
    public class Test
    private String laRequete = new String(
    "POST http://localhost:5577/Test/ HTTP/1.0\r\n"+
    "Host:localhost:5577\r\n"+
    "\r\n");
    PrintWriter laSortie;
    BufferedReader lEntree;
    Socket laSocketTCP;
    public Test()
    String tmp;
    try
    laSocketTCP = new Socket("localhost", 5577);
    laSortie = new PrintWriter(laSocketTCP.getOutputStream());
    lEntree = new BufferedReader(new InputStreamReader(laSocketTCP.getInputStream()));
    laSortie.println(laRequete);
    laSortie.flush();
    // Premier essai OK
    System.out.println(lEntree.readLine());
    while((tmp = lEntree.readLine()) != null)
    System.out.println(tmp);
    // Second essai => Not OK
    laSortie.println(laRequete);
    laSortie.flush();
    System.out.println(lEntree.readLine());
    while((tmp = lEntree.readLine()) != null)
    System.out.println(tmp);
    catch (Exception e)
    e.printStackTrace();
    public static void main(String args[])
    Test tp = new Test();
    Here is the result of the execution
    HTTP/1.1 200 OK
    Date: Wed, 29 Sep 2004 08:35:35 GMT
    Server: Apache/2.0.51 (Win32)
    Last-Modified: Wed, 29 Sep 2004 08:27:57 GMT
    ETag: "23a46-9a-56c93f9a"
    Accept-Ranges: bytes
    Content-Length: 154
    Connection: close
    Content-Type: text/html; charset=ISO-8859-1
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> Index Test 1 </TITLE>
    </HEAD>
    <BODY>
    Test 1
    </BODY>
    </HTML>
    null
    Thanks, bye.

    Send an HTTP 1.1 request instead of a 1.0 request.
    HTTP 1.0 does not support keeping the connection open, so yes, the server closes the connection.
    Dave.

  • My iphone 4S wont allow me to restore a bckup of icloud it has just rebooted the os and for over 24 hours i have been trying to fix it i use this phone for my job so i need help

    My iphone 4S wont allow me to restore a bckup of icloud it has just rebooted the os and for over 24 hours i have been trying to fix it i use this phone for my job so i need help. when i try to restore it says "Your iphone could not be activated becuase the activation server is unavailable, If the problom presests goto apple.com/support"   It has done this for 27 hours now PLEASE HELP!!!!!!!!!

    - Connect the iPod to the computer and see if iTunes sees it. If it sees it try to get the photos off the iPod.
    - Next let the battery fully drain. It will likely take days. After charging for at least an hour try again
    - Last, make an appointment at the Genius Bar of an Apple store.

  • I need help, speach over got accidently turned on in my Iphone 6, now i cant get into my phone it wont take my pass word and when I try to use Siri it says not available  what do I do

    I need help, speach over got accidently turned on in my Iphone 6, now i cant get into my phone it wont take my pass word and when I try to use Siri it says not available  what do I do

    Hi, Jennifer.  
    Thank you for visiting Apple Support Communities.  
    I understand that VoiceOver has been activated and you are unable to access your device.  I have done this myself and here are the steps to disable this feature.  
    VoiceOver
    Press the home button three times quickly (formerly "Triple-click home").
    Accessibility Shortcut
    Managing Accessibility features using iTunes
    Connect your iPhone, iPad, or iPod touch to any computer with iTunes installed.
    In iTunes, select your device.
    From the Summary pane, click > Configure Universal Access in the Options section at the bottom.
    Select the feature you would like to use and click OK.
    Use Accessibility features in iOS
    -Jason H.  

  • Need help with duplicate print jobs over network that I can't cancel

    I have the Photosmart Premium All-in-One on my home network.  My kids who each have laptop running Windows 7 and are connected via wireless to the printer via a DLINK DIR-655.
    They hit the print button too many times and it keeps printing over and over again.
    Is there a way to get the printer to stop printing these duplicates.  I tried turning off/on but they just keep printing.
    We're wasting paper/ink and I need help with a solution.
    Please let me know.  Thanks.
    Angelo

    There should be a button with a red 'X' on it on the front of the printer.  This is the print cancel button.
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • HT4314 Hi i need help please i been playing clash of clans over 13 months. And today o realise what someone using my game Centra. Someone playing on my game Clash of Clans. I been change my Apple ID password, email, but doesn't work. Then I playing game I

    Hi i need help please i been playing clash of clans over 13 months. And today o realise what someone using my game Centra. Someone playing on my game Clash of Clans. I been change my Apple ID password, email, but doesn't work. Then I playing game I can see what someone else trying connecting to my game And I don't know what to do.So if you can help me please? I don't wanna lose my game.

    Contact iTunes
    Contact iTunes

  • Hi i need help please i been playing clash of clans over 13 months. And today o realise what someone using my game Centra. Someone playing on my game Clash of Clans. I been change my Apple ID password, email, but doesn't work. Then I playing game I can se

    Hi i need help please i been playing clash of clans over 13 months. And today o realise what someone using my game Centra. Someone playing on my game Clash of Clans. I been change my Apple ID password, email, but doesn't work. When I playing game I can see what someone else trying connecting to my game And I don't know what to do.So if you can help me please? I don't wanna lose my game. 

    Hello Vaidas Vaidas,
    It sounds like you are noticing someone else is accessing your Clash of Clans data by playing the game and you have tried to reset your Apple ID password. If you are following the steps outlined in this article:
    Apple ID: Changing your password
    http://support.apple.com/kb/ht5624
    What is preventing you from changing your password? Any error messages or prompts?
    Thank you for using Apple Support Communities.
    All the best,
    Sterling

  • Need help connecting a windows network printer to my Mac (Xerox Phaser 3600) over a windows home network

    Need help connecting a windows network printer to my Mac (Xerox Phaser 3600) over a windows home network.
    My Mac runs lion and the windows desktop runs Windows XP
    I have tried for a few hours or so to connect my mac to this printer over a home network.
    For your information it does work when connected directly to my mac using a USB Cable.
    If there is no soultion could I have help getting the drivers for a Dell All-in-One Photo 926

    In most cases you can connect to the Windows shared printer from the Mac. But there is a dependence on the Mac driver being compatible. For many consumer inkjets, the vendor created driver cannot be used for this type of connection so you need to look at alternative drivers, such as Gutenprint or PrintFab. If you can tell us which brand and model of printer you have shared from Windows then we can answer your question with the preferred procedure on the Mac.

  • HT1338 I AM HAVING SO MANY PROBLE TRYING TO DOWNLOAD Mac OS X version 10.7.5 TO MY MACBOOK, I NEED HELP, I HAVE ALREADY PURCHASE THIS PRODUCT OVER A MONTH AGO

    I AM HAVING SO MANY PROBLEMS TRYING TO DOWNLOAD Mac OS X version 10.7.5 TO MY MACBOOK, I NEED HELP, I HAVE ALREADY PURCHASE THIS PRODUCT OVER A MONTH AGO

    lkimmie wrote:
    I AM HAVING SO MANY PROBLEMS TRYING TO DOWNLOAD Mac OS X version 10.7.5 TO MY MACBOOK, I NEED HELP, I HAVE ALREADY PURCHASE THIS PRODUCT OVER A MONTH AGO
    Firstly, please turn off your Caps lock. It is considered shouting in forums.
    Secondly, please explain your exact issue and wheteher or not you can see your purchase in the App Store and if you are using the same Apple ID to reinstall it with as you used to purcase it with.
    Thanks
    Pete

Maybe you are looking for