Objects over the network

is it possible to read in an object from a reader.println(Object x); type method?

For your networking questions, first read:
http://java.sun.com/docs/books/tutorial/networking/index.html
(read "Overview of Networking" and "All About Sockets")
That will get you started with a simple client/server package. Then go to the API (http://java.sun.com/j2se/1.4/docs/api/index.html) and look at the java.io.* package. You'll probably want to peek at the various Input/Output stream classes for using Objects (i.e. ObjectInputStream/ObjectOutputStream). It shouldn't be too difficult to figure out all you need from the above tutorial and the javadoc API. Once you get going, if you have problems, post specific code and/or exceptions here and it'll be easier for people to help.
Good luck
-Eric

Similar Messages

  • Sending Connection Object over the Network using RMI

    Hi,
    How can a Connection object be sent over the network and run on another JVM. I need to hold connection object to execute processes one after other, that require Oracle connection without ever connecting again. I do not have J2EE container or webserver setup to hold connection/connectionpool,but need to run the process on command line. I am using RMI infrastructure to pass parameters/return values but connection object is not serializable and connot be marshalled and failing. Please explain, if there is another way using JDK 1.4
    Sudheer

    I think that what you want to do is connect to the database on the RMI server object, then use the server object from your remote clients to execute the processes you require to rrun.

  • Sending Connection object over the network

    Hi,
    How can a Connection object be sent over the network and run on another JVM. I need to hold connection object to execute processes one after other, that require Oracle connection without ever connecting again. I do not have J2EE container or webserver setup to hold connection/connectionpool,but need to run the process on command line. I am using RMI infrastructure to pass parameters/return values but connection object is not serializable and cannot be marshalled and failing. Please explain, if there is another way using JDK 1.4
    Sudheer

    I don't believe this is possible. A connection object has a number of associated structures on the operating system, which generally makes it impossible to move. From a fundamental networking level, you also cannot, in general, cause a connection to machine1 to start communicating with machine2-- that would introduce all manner of security problems.
    Why don't you want to just create another connection on the other machine?
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Can object transfer over the network without serialization?

    Hi all,
    Can we send the objects over the network (from clent to server)
    without seraializing it?
    Thanks in advance

    Yes. By sending its values by any other means, like as XML.

  • Need to send object instances over the network

    I found no other way to implement a switch case to cast objects on both sides to solve my problem.
    Basically I need to send objects over a network protocol based on XML, the object is sent inside XML
    converted in base64, overall encoding of XML is utf-8.
    Let's suppose in my network there are 2 peers connected via socket.
    I have multiple instances of different types on both peers but I want to keep these instances
    synchronized. If something changes on side A, side B must receive that instance and replace
    it in the correct place (just one way, from A to B).
    When I receive such instance on B I want to cast it to it's proper instance
    of it's proper type and I am scratching my head on how could I implement this without some
    sort of unique ID table and switch case.
    If I had 1 instance per type could it be done easily?
    But I need to keep in synch many instances per type.
    Is there any dynamic casting that I can trigger based on some type/instanceID information
    I could send along the object?

    I found no other way to implement a switch case to cast objects on both sides to solve my problem.
    Basically I need to send objects over a network protocol based on XML, the object is sent inside XML
    converted in base64, overall encoding of XML is utf-8.
    Let's suppose in my network there are 2 peers connected via socket.
    I have multiple instances of different types on both peers but I want to keep these instances
    synchronized. If something changes on side A, side B must receive that instance and replace
    it in the correct place (just one way, from A to B).
    When I receive such instance on B I want to cast it to it's proper instance
    of it's proper type and I am scratching my head on how could I implement this without some
    sort of unique ID table and switch case.
    If I had 1 instance per type could it be done easily?
    But I need to keep in synch many instances per type.
    Is there any dynamic casting that I can trigger based on some type/instanceID information
    I could send along the object?

  • I need to copy files over the network PSSession . ( Firewall / DMZ / Etc. )

    Hello
    I need to copy files over the network PSSession . ( Firewall / DMZ / Etc. )
    I have a script where I copy from my local server ( server1) to the remote server ( server2 ), but I can´t not make script that will copy from the remote server to my local by my session. From server2 to server1
    Script is as below ...:-)
    HELP : ....
    winrm s winrm/config/client '@{TrustedHosts="SERVER2"}'
        $Source = "D:\test\ok.log"
        $Destination = "D:\test\ok.log"
        $session = New-PSSession -ComputerName SERVER2
    Set-StrictMode -Version Latest
    ## Get the source file, and then get its content
    $sourcePath = (Resolve-Path $source).Path
    $sourceBytes = [IO.File]::ReadAllBytes($sourcePath)
    $streamChunks = @()
    ## Now break it into chunks to stream
    Write-Progress -Activity "Sending $Source" -Status "Preparing file"
    $streamSize = 1MB
    for($position = 0; $position -lt $sourceBytes.Length;
        $position += $streamSize)
        $remaining = $sourceBytes.Length - $position
        $remaining = [Math]::Min($remaining, $streamSize)
        $nextChunk = New-Object byte[] $remaining
        [Array]::Copy($sourcebytes, $position, $nextChunk, 0, $remaining)
        $streamChunks += ,$nextChunk
    $remoteScript = {
        param($destination, $length)
        ## Convert the destination path to a full filesytem path (to support
        ## relative paths)
        $Destination = $executionContext.SessionState.`
            Path.GetUnresolvedProviderPathFromPSPath($Destination)
        ## Create a new array to hold the file content
        $destBytes = New-Object byte[] $length
        $position = 0
        ## Go through the input, and fill in the new array of file content
        foreach($chunk in $input)
            Write-Progress -Activity "Writing $Destination" `
                -Status "Sending file" `
                -PercentComplete ($position / $length * 100)
            [GC]::Collect()
            [Array]::Copy($chunk, 0, $destBytes, $position, $chunk.Length)
            $position += $chunk.Length
        ## Write the content to the new file
        [IO.File]::WriteAllBytes($destination, $destBytes)
        ## Show the result
        Get-Item $destination
        [GC]::Collect()
    ## Stream the chunks into the remote script
    $streamChunks | Invoke-Command -Session $session $remoteScript `
        -ArgumentList $destination,$sourceBytes.Length
        Remove-PSSession -Session $session

    But have will the script look,  if i need to copy from
    From server2 to server1.
    My script copy from server1 to server2 and working, but I need server2
    to server1.

  • I want to share my external hard drive over the network

    I found a lot of threads and discussions about this, but no answers.
    I have a WD My Book External Hard Drive that I'm looking to share over the network. However, when I add the volume to the "Shared Folders" or even a folder within the volume and the "Users:" are grayed out.
    When getting info on the volume, Sharing & Permissions says, "You can read and write"
    Any ideas?

    Hi Keith,
    Thanks for your response; however, the first screenshot is through the Sharing settings in the System Preferences.

  • HP Laserjet M1132 MFP is too slow over the network!

    Hi,
    My HP Laserjet M1132 MFP is too slow over the network!
    I have connect the printer to a windows XP 32bit SP3 using UBS port. The printer works fine on the local computer but when sharing it over the network it works too slow, for example with print test page it takes about 45 seconds to print and for other documents it takes much longer time.
    I have installed the latest driver form HP website and upgrade the firmware it the latest version.
    It happens on other Windows XP machines as well.
    I connected the printer to my laptop (Windows 7 64bit) and it works fine (No delays over the network) and it seems that this problem have some relations with the windows XP Driver.
    I have used local port trick on remote machines (instead of regular method) like this:
    ''add a local printer;
    'new port'
    'localport'
    \\XPcomputer\HPPrinterName as port name
    but still nothing!
    There is nothing wrong with the network, we use to use a Samsung printer on the same machines over the network with no problem.
    I Really appreciate your HELP!
    This question was solved.
    View Solution.

    BEHZAD_T, how is the printer connected to the network (wireless or Ethernet)? If it is slow wirelessly, I would suggest trying to connect the printer to your router with the Ethernet cord and install it to the networked computer that way.
    Another question is, relatively speaking, how close to your router are the Samsung printer and the HP printer? Depending on the distance (and what stands between the devices) there can be a lag between sending a print job and it being received by the printer.
    Let me know!

  • WinRM cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the network

    The Exchange Management Shell fails to connect in Exchange 2013 environment, this is a DAG environment and previously it indicates another error message, which is in my another thread. We fixed that error by delete the retired proxy entry in the server registry,
    after that the error is gone but changed to below one, anyway the EMS still fails to connect to all servers:
    VERBOSE: Connecting to NSWVIP999WTMBX.air.abc.au.
    New-PSSession : [NSWVIP999WTMBX.air.abc.au] Connecting to remote server NSWVIP999WTMBX.air.abc.au failed with the
    following error message : WinRM cannot complete the operation. Verify that the specified computer name is valid, that
    the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows
    access from this computer. By default, the WinRM firewall exception for public profiles limits access to remote
    computers within the same local subnet. For more information, see the about_Remote_Troubleshooting Help topic.
    At line:1 char:1
    + New-PSSession -ConnectionURI "$connectionUri" -ConfigurationName Microsoft.Excha ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
       gTransportException
        + FullyQualifiedErrorId : WinRMOperationTimeout,PSSessionOpenFailed
    Failed to connect to an Exchange server in the current site.
    Enter the server FQDN where you want to connect.:
    Then it just show can't connect to all the exchange servers, from the wording it seems pointing to the Windows firewall settings for winRM, but when I look at the windows firewall found it's turned off. We use Sophos enterprise for the security, but all
    other 3 exchange servers didn't have the same issue.

    Hi Lynn,
    Thanks for your analyst and reply, I run the command as you suggested and checked accordingly to Task Manager, but seems none of them indicates a firewall or anti-virus.
      TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       4
     TCP    0.0.0.0:808            0.0.0.0:0              LISTENING       2260
     TCP    172.17.2.123:444       172.16.2.127:8050      ESTABLISHED     4
     TCP    172.17.2.123:444       172.16.2.127:8069      ESTABLISHED     4
     TCP    172.17.2.123:444       172.17.2.127:8053      ESTABLISHED     4
     TCP    172.17.2.123:10952     172.16.2.68:80         ESTABLISHED     3296
     TCP    172.17.2.123:11185     172.16.2.90:8080       SYN_SENT        468
     TCP    172.17.2.123:11190     172.16.2.90:8080       SYN_SENT        15268
     TCP    172.17.2.123:11330     172.16.2.90:8080       SYN_SENT        1296
     TCP    [::]:80                [::]:0                 LISTENING      
    4
     TCP    [::]:808               [::]:0                 LISTENING      
    2260
     TCP    [::1]:6001             [::1]:8028             ESTABLISHED     4764
     TCP    [::1]:6001             [::1]:8029             ESTABLISHED     4764
     TCP    [::1]:6001             [::1]:8030             ESTABLISHED     4764
     TCP    [::1]:6001             [::1]:8031             ESTABLISHED     4764
     TCP    [::1]:6001             [::1]:8032             ESTABLISHED     4764
     TCP    [::1]:6001             [::1]:8033             ESTABLISHED     4764
     TCP    [::1]:6001             [::1]:8034             ESTABLISHED     4764
     TCP    [::1]:6001             [::1]:8035             ESTABLISHED     4764
     TCP    [::1]:6001             [::1]:8036             ESTABLISHED     4764
     TCP    [::1]:6001             [::1]:8037             ESTABLISHED     4764
     TCP    [::1]:6001             [::1]:8040             ESTABLISHED     4764
     TCP    [::1]:6001             [::1]:8041             ESTABLISHED     4764
     TCP    [::1]:6001             [::1]:8048             ESTABLISHED     4764
     TCP    [::1]:6001             [::1]:8049             ESTABLISHED     4764
     TCP    [::1]:6001             [::1]:8059             ESTABLISHED     4764
     TCP    [::1]:6001             [::1]:8060             ESTABLISHED     4764
     TCP    [::1]:8028             [::1]:6001             ESTABLISHED     9980
     TCP    [::1]:8029             [::1]:6001             ESTABLISHED     9980
     TCP    [::1]:8030             [::1]:6001             ESTABLISHED     9980
     TCP    [::1]:8031             [::1]:6001             ESTABLISHED     9980
     TCP    [::1]:8032             [::1]:6001             ESTABLISHED     9980
     TCP    [::1]:8033             [::1]:6001             ESTABLISHED     9980
     TCP    [::1]:8034             [::1]:6001             ESTABLISHED     9980
     TCP    [::1]:8035             [::1]:6001             ESTABLISHED     9980
     TCP    [::1]:8036             [::1]:6001             ESTABLISHED     9980
     TCP    [::1]:8037             [::1]:6001             ESTABLISHED     9980
     TCP    [::1]:8040             [::1]:6001             ESTABLISHED     9980
     TCP    [::1]:8041             [::1]:6001             ESTABLISHED     9980
     TCP    [::1]:8048             [::1]:6001             ESTABLISHED     9980
     TCP    [::1]:8049             [::1]:6001             ESTABLISHED     9980
     TCP    [::1]:8059             [::1]:6001             ESTABLISHED     9980
     TCP    [::1]:8060             [::1]:6001             ESTABLISHED     9980
     TCP    [fe80::9054:e8f5:f885:8105%20]:808  [fe80::9054:e8f5:f885:8105%20]:9901
     ESTABLISHED     2260
     TCP    [fe80::9054:e8f5:f885:8105%20]:9901  [fe80::9054:e8f5:f885:8105%20]:808
     ESTABLISHED     4868
    This is the full result, among them
    4 -- System -- NT Kernel & System
    468 -- There is no process associated with PID 468
    1296 -- svchost.exe -- Host Process for Windows Service
    2260 -- SMSvcHost.exe -- SMSvcHost.exe
    3296 -- CcmExec.exe -- CCM Executive
    4764 -- Microsoft.Exchange.RpcClientAccess.Service.exe -- Microsoft.Exchange.RpcClientAccess.Service.exe
    4868 -- Microsoft.Exchange.ServiceHost.exe -- Microsoft.Exchange.ServiceHost.exe
    9980 -- w3wp.exe -- IIS Worker Process
    15268 -- ServerManager.exe -- Server Manager

  • Airport won't print over the network

    I have a basic HP Photosmart C4200 series printer. It works fine when I plug it directly into my computer but when I plug it into the router, it won't print and this message comes up : "Unable to read response header - short read"
    When I delete/add the printer from Preferences, it finds the printer and establishes connection but when I try to print over the network, it gives me that error message.
    A weird thing I found was that when connected to the airport, my printer shows up under the iDisks tab under the Airport Utilities instead of being in the Printers tab...

    Welcome to the discussions!
    A number of entry level printers are designed so that they will only work when they are connected directly to a computer, so that may possibly explain your problem.
    To verify, you can work your way through Apple's troubleshooting guide to see if this is the case. If you've completed all the steps and still can't print, I think you have your answer.
    http://support.apple.com/kb/TS1253
    http://support.apple.com/kb/TS1253

  • Printer HP Envy 4500 Series cannot be contacted over the network

    My wireless printing chooses when it wants to work, and right now it's really acting up. It is connected wirelessly, it is the default printer, but after troubleshooting it is telling me "Printer HP Envy 4500 Series cannot be contacted over the network." What can I do to get printing again?

    Hello featherfamily,
    Welcome to the HP Forums.
    I see that you are having an issue with the printer not connecting with a wireless connection.
    Please click on the following link that deals with when the 'Printer is offline' Message Displays on the Computer and the Printer Does Not Print: Windows 7.
    Please make sure that you have the printer power cable connected directly to a wall outlet and not a power bar/strip. Here is a document that uses a LaserJet printer as an example but it is meant for HP products in general. Please click on the following link that explains the Issues when Connected to an Uninterruptible Power Supply/Power Strip/Surge Protector.
    If the troubleshooting does not help resolve your issue, I would then suggest calling HP's Technical Support to see about further options for you. If you are calling within North America, the number is 1-800-474-6836 and for all other regions, click here: click here.
    Thanks for your time. 
    Click the “Kudos Thumbs Up" at the bottom of this post to say “Thanks” for helping!
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    W a t e r b o y 71
    I work on behalf of HP

  • Pinging a printer to see if it works over the network

    I've been printing from a Windows 7 computer to a PSC C6180 over a wireless network.  All of a sudden it stopped printing.  I don't if a power surge or something blew some stuff out (the fax part is already gone) or if it is something else. 
    I removed the printer and removed the installed software in order to put it back in its "initial state." 
    Before I removed the software, I tried to add a network printer to see if that would do it.   At the point in the process where it looks for printers, it didn't find it.  It makes me wonder if it will work over the network at all, but I do note the blue 802.11g LED is lit.
    Before I reinstall the software (AIO_CDA_FSW_Full_Win_WW.130_140.exe is what I have) I want to ping the printer and see if the computer can see it.  What's the ping address?

    Hello ErnieLane,
    Please follow steps 1-4 described in Access the Embedded Web Server to print a configuration page, it will contain the current IP address (if any).
    Hope this will help.
    Regards,
    AndOne
    Say "Thanks" by clicking the Kudos Star in the post that helped you.
    Please mark the post that solves your problem as "Accepted Solution"
    (Although I am employed by HP, I am speaking for myself and not for HP)

  • Unable to print to USB printer over the network

    Hi all,
    I have an iMac and an Macbook Air, both running 10.6.4, and I've got an HP LaserJet 1200 printer connected to the iMac by USB. Both machines are on my home wireless network (Linksys, FWIW).
    I seem to be unable to print to the LaserJet over the network from my Air. I've tried all manner of permutations of printer setup on the Air: IPP/LPD/HP JetDirect; entering the hostname (*.local) and the IP address of the host; leaving the queue blank and not; and leaving "Print Using" as generic vs selecting the LaserJet drivers. The printers appear in the "Default" Add Printer menu as Bonjour Shared, but this doesn't seem to work either.
    Following other threads, I've tooled around with CUPS (resetting the configuration file, etc.), with no success. The other threads I've found on the subject seem to be more specifically addressed to folks trying to use an AirPort.
    Any suggestions for what to try next?

    In that case, let me elaborate on what happens when I try to set up the printer via Bonjour, in case there are any clues in the behavior that I'm seeing. The printer seems to appear twice in the "Default" pane, with Kind as 'Bonjour Shared' and Printer Names as follows:
    HP LaserJet 1200 @ (hostname)
    HP LaserJet 1200 @ (hostname) @ (hostname)
    Selecting the first, it displays "Gathering printer information..." for a few minutes, then strikes out, suggesting Generic PostScript Printer rather than the correct driver. Whether I stick with that or select the correct driver manually and then try to print, it hangs on 'Copying print data..." (in the print queue).
    Selecting the second, it gathers printer information only for a second or two before settling on Generic PostScript Printer. If I stick with Generic PostScript Printer, it hangs on 'Connected to printer...' but if I select the correct driver, it hangs on 'Copying print data...' again.

  • Fax over the network with HP LaserJet 400 ColorMFP M475dw

    Hi there, I was trying to send fax over the network with  HP LaserJet 400 ColorMFP M475dw, I have connected the printer/scan/fax on a wired network, just have 3 computers on it, all of them  can scan or print. But I can't find any option to just FAX from Microsoft Word or Adobe Acrobat Reader, going to File ---> Print ---> and select M475dw "FAx", I installed the lasted version of the drivers downloaded from hp.com and there's no way to install this multifunction printer as a FAX.
    So I can't see the FAX on Printers in the control panel of windows.
    I have never got an error message from any computer during the installation process either.
    Does anyone has an idea of what to do here?
    Thanks ahead.

    Thanks for your quick answer, I really appreciate it. But unfortunately, it didn't resolve my problem  
    Actually any of the workstations after complete the installation (with the last version of drivers downloaded just now from hp.com) can't recognize the HP LaserJet Pro 400 Color MFP M475dw, as a fax. I can print and scan over the network, or connecting the printer with a usb cable. I just can't see the icon "HP LaserJet Pro 400 Color MFP M475dw FAX" in Control Panel ---> Devices and Printers.   I did a full installation when I were asked during the installation process... I did then I custom installation and neither of them seems to work to me  
    This is very strange, it never happened to me with any other models of all-in-on (printer/fax/scanner)

  • Is it possible to add an HP all in one printer to my vetwork via UBS on an Airport Extreme so that the scanner and print functions are available over the network?

    Im very new to this "networking thing" so your patience is welcome. I have managed to get the Time capsual AE up and running and thanks to bonjour I have a printer via USB working. However, its an all in one machine and I can not work out how to get the scanner to work over the network - or even if its possible. Is this possible?

    No, you cannot scan over the network, unless the printer has network capability.. in which case the printer must connect via ethernet or wireless not USB.
    All USB printers are designed as local printers not network.

Maybe you are looking for