FTP delays answering zOS client

I have a Solaris 9 FTP server serving zOS jobs
Sometimes, the FTP client outputs the messages:
Connecting to: solaris9.ftp.server xxx.xxx.xxx.xxx port: 21.
Connection to server interrupted or timed out.
Server not responding, closing connection.
FTP Return Code = 10000, Error Code = 00009
I used snoop to trace the connection, with the following:
130 8.29945 yyy.yyy.yyy.yyy -> solaris9 FTP C port=3776
131 0.00015 solaris9 -> yyy.yyy.yyy.yyy FTP R port=3776
132 0.28311 yyy.yyy.yyy.yyy -> solaris9 FTP C port=3776
133 60.00031 yyy.yyy.yyy.yyy -> solaris9 FTP C port=3776
134 0.00010 solaris9 -> yyy.yyy.yyy.yyy FTP R port=3776
135 20.16155 solaris9 -> yyy.yyy.yyy.yyy FTP R port=3776 220 solaris9 FTP ser
136 0.00102 solaris9 -> yyy.yyy.yyy.yyy FTP R port=3776 221 You could at lea
137 0.46158 10.135.150.141 -> sappvfci FTP C port=3776
138 0.00008 10.135.150.141 -> sappvfci FTP C port=3776
I'm thinking the FTP is spending more than 60 seconds to reply and the client is closing the connection... is this correct?
Is there a way to increase the time of in.ftpd response ?

Here is a sample of a failed connection.
10.x.x.x is the private IP of our FTP server (manually masked out)
Status: Connecting to 12.x.x.x ...
Status: Connected with 12.x.x.x. Waiting for welcome message...
Response: 220 Service Ready for new User
Command: USER greenman
Response: 331 Password Needed for Login
Command: PASS *************
Response: 230 User greensman Logged in Successfully
Command: SYST
Response: 215 NETWARE Type: L8
Command: FEAT
Response: 500 'FEAT' : Unknown Command
Status: Connected
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is Current Directory
Command: TYPE A
Response: 200 TYPE Command OK A
Command: PASV
Response: 227 Entering Passive Mode (10,x,x,x,6,34)
Command: LIST
Response: 150 Opening data connection for (10.x.x.x,1570)
Here is a log of a working connection:
Response: 220 Service Ready for new User
Command: USER greenman
Response: 331 Password Needed for Login
Command: PASS *************
Response: 230 User greensman Logged in Successfully
Command: SYST
Response: 215 NETWARE Type: L8
Command: FEAT
Response: 500 'FEAT' : Unknown Command
Status: Connected
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is Current Directory
Command: TYPE A
Response: 200 TYPE Command OK A
Command: PORT 192,168,x,x,5,112
Response: 200 PORT Command OK
Command: LIST
Response: 150 Opening data connection for (24.255.xx.xx,41346)
Response: 226 Transfer Complete
Status: Directory listing successful

Similar Messages

  • How to FTP a file from client machine to database server using forms 10g

    Hi
    I want to ftp a file from a client machine to the database server machine using forms 10G (or PL/SQL).
    could you please tell me how can I do this
    Regards

    hi
    How to get up and running with WebUtil 1.06 included with Oracle Developer Suite 10.1.2.0.2 on a win32 platform
    Solution
    Assuming a fresh "Complete" install of Oracle Developer Suite 10.1.2.0.2,
    here are steps to get a small test form running, using WebUtil 1.06.
    Note: Oracle_Home is used as an alias for your real oDS ORACLE_HOME.
    Feel free to copy this note to a text editor, and do a global find/replace on
    Oracle_Home with your actual value (no trailing slash). Then it is easy to
    copy/paste actual commands to be executed from the note copy.
    1) Download http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
    and extract to a temporary staging area. Do not attempt to use 1.7 or 1.9.
    2) Copy or move jacob.jar and jacob.dll
    C:\webutile is the folder where you extracted Jacob, and will end in ...\jacob_18
    cd C:\webutile
    copy jacob.jar Oracle_Home\forms\java\.
    copy jacob.dll Oracle_Home\forms\webutil\.
    The Jacob staging area is no longer needed, and may be deleted.
    3) Sign frmwebutil.jar and jacob.jar
    Open a DOS command prompt.
    Add Oracle_Home\jdk\bin to the PATH:
    set PATH=Oracle_Home\jdk\bin;%PATH%
    Sign the files, and check the output for success:
    Oracle_Home\forms\webutil\sign_webutil Oracle_Home\forms\java\frmwebutil.jar
    Oracle_Home\forms\webutil\sign_webutil Oracle_Home\forms\java\jacob.jar
    4) If you already have a schema in your RDBMS which contains the WebUtil stored code,
    you may skip this step. Otherwise,
    Create a schema to hold the WebUtil stored code, and privileges needed to
    connect and create a stored package. Schema name "WEBUTIL" is recommended
    for no reason other than consistency over the user base.
    Open Oracle_Home\forms\create_webutil_db.sql in a text editor, and delete or comment
    out the EXIT statement, to be able to see whether the objects were created witout
    errors.
    Start SQL*Plus as SYSTEM, and issue:
    CREATE USER webutil IDENTIFIED BY [password]
    DEFAULT TABLESPACE users
    TEMPORARY TABLESPACE temp;
    GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO webutil;
    CONNECT webutil/webutil@rcci
    @Oracle_Home\forms\create_webutil_db.sql
    -- Inspect SQL*Plus output for errors, and then
    CREATE PUBLIC SYNONYM webutil_db FOR webutil.webutil_db;
    Reconnect as SYSTEM, and issue:
    grant execute on webutil_db to public;
    5) Modify Oracle_Home\forms\server\default.env, and append Oracle_Home\jdk\jre\lib\rt.jar
    to the CLASSPATH entry.
    6) Modify Oracle_Home\forms\server\formsweb.cfg insde [default] add :
    archive_jini=frmall_jinit.jar,frmwebutil.jar,jacob.jar
    archive=frmall.jar
    also add :
    [webutil]
    WebUtilLogging=off
    WebUtilLoggingDetail=normal
    WebUtilErrorMode=Alert
    WebUtilDispatchMonitorInterval=5
    WebUtilTrustInternal=true
    WebUtilMaxTransferSize=16384
    baseHTMLjinitiator=webutiljini.htm
    baseHTMLjpi=webutiljpi.htm
    baseHTML=webutilbase.htm
    archive_jini=frmall_jinit.jar
    WebUtilArchive=frmwebutil.jar,jacob.jar,f90all.jar
    archive=frmwebutil.jar,f90all.jar
    lookAndFeel=oracle
    7) Modify Oracle_Home\forms\server\webutil.cfg and add :
    transfer.database.enabled=TRUE
    transfer.appsrv.enabled=TRUE
    8) Start the OC4J instance
    9) Start Forms Builder and connect to a schema in the RDBMS used in step (4).
    Open webutil.pll, do a "Compile ALL" (shift-Control-K), and generate to PLX (Control-T).
    It is important to generate the PLX, to avoid the FRM-40039 discussed in Note 303682.1
    If the PLX is not generated, the Webutil.pll library would have to be attached with
    full path information to all forms wishing to use WebUtil. This is NOT recommended.
    10) Create a new FMB.
    Open webutil.olb, and Subclass (not Copy) the Webutil object to the form.
    There is no need to Subclass the WebutilConfig object.
    Attach the Webutil.pll Library, and remove the path.
    Add an ON-LOGON trigger with the code
    NULL;
    to avoid having to connect to an RDBMS (optional).
    Create a new button on a new canvas, with the code
    show_webutil_information (TRUE);
    in a WHEN-BUTTON-PRESSED trigger.
    Compile the FMB to FMX, after doing a Compile-All (Shift-Control-K).
    11) Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if
    the "Application Server URL" is empty.
    Then append "?config=webutil" at the end, so you end up with a URL of the form
    http://server:port/forms/frmservlet?config=webutil
    12) Run your form.

  • BizTalk 2010 Send FTPS - when is my client certificate needed?

    Based on this
    post, it's very unclear if a certificate is needed or not (in the Client Certificate Hash).  The most important quote I got out of that post is this:
    "I reached out to MS BizTalk support and they asked me not to use the certificate and just use FTP over SSL without certificate. We also changed the ftp firewall mode to passive and allocate storage to no."
    If FileZillaClient can connect and send a file to a customer/vendor without a local certificate, then why would BizTalk need one in an FTP SendPort?
    And secondly, if it is not needed, in what circumstances would you use it on an FTP SendPort.
    It's my understanding that the certificate is some certificate related to the BizTalk host account's personal store on the BizTalk machine, and not the thumbprint of the customer/vendor we are communicating with.
    For BT2013 this is
    MSDN's mysterious definition:
    > Specify the SHA1 hash of the client certificate that must be used in
    > the Secure Sockets Layer (SSL) negotiation.
    >
    > Based on this hash, the client certificate is picked up from the
    > personal store of the user account under which the BizTalk host
    > instance is running.
    This statement gives no guidance as to when it is needed or desired.
    This is the
    other good blog on the subject, but also implied cert is needed, in contradiction to Microsoft support in early link.
    Thanks,
    Neal Walters
    http://MyLifeIsMyMessage.net

    Hi,
    #How to use the new “FTPS adapter” with BizTalk 2010
    http://blogical.se/blogs/mikael/archive/2010/09/26/how-to-use-the-new-ftps-adapter-with-biztalk-2010.aspx
    And it should work with self-signed cert.Please refer to the demo:
    http://blogs.msdn.com/b/biztalknotes/archive/2014/10/10/using-ftps-adapter-in-biztalk-ftp-ssl.aspx
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Yahoo! Voice on SPA2102: problem with delayed answer supervision

    My SPA2102 running 5.2.3 is configured for Yahoo! Voice on Line 1.  Inbound and outbound calls are generally excellent, but there is a problem calling certain US toll-free numbers; one cannot send DTMF or speech to control the IVR that answers.  Here are the details:
    The Yahoo! Messenger softphone sends and receives its RTP packets (encapsulated in UDP as usual) via a 'relay' server.  This occurs whether or not the PC running Messenger is behind a NAT.  Unfortunately, I cannot duplicate this behavior on the SPA.  When I set STUN Server: stun.voice.yahoo.com, TURN Server: relay.voice.yahoo.com:443, and Auth Server: login.yahoo.com, the system is fully functional, but the RTP is TCP encapsulated, packetization varies greatly, latency is long, and minor packet loss or delay results in very choppy voice.  This happens even when the device is on an unrestricted public IP and the STUN server responses correctly indicate no NAT.  I've tried all manner of SPA settings attempting to use the relay in UDP mode, to no avail.
    The above by itself is no big deal, because I'd rather avoid the relay server altogether -- it only adds complexity, delay and jitter.  If I set TURN Server: 0.0.0.0 (and SPA is on a public IP), then one can make and receive calls with RTP/UDP packets going directly to/from the carrier's server.  For example, if a call is sent via AT&T, the RTP packets come from (and go to) an AT&T media server, with no Yahoo! servers in the media path at all, resulting in the lowest latency and best quality of any VoIP service I've tested.  This will also work when the device is behind a NAT, if you turn on NAT Mapping Enable and Handle VIA Received, and forward the appropriate RTP port range in the router to the SPA.
    Unfortunately, there's a gotcha:  Many large toll-free users (example: IBM on 800-426-7378) have IVR systems that don't provide 'answer supervision' until the call is connected to a human.  (Their contracts don't require them to pay minutes for the IVR portion of the call; they signal 'answer' to their carrier when billing is to start.)  In SIP terms, this means that you get a 183 Progress response when the IVR comes on, but there is no 200 OK until a human picks up.  However, when configured as described, the SPA doesn't send any RTP packets until the 200 OK is received.  This means that you hear the IVR but can't control it with DTMF or with speech.  I don't know why this should be -- when not in Yahoo! mode, an SPA will normally start sending RTP as soon as the SDP tells it to, typically upon receipt of a 183 Progress.  I've confirmed that the SDP sent with the 183 does specify a valid send/receive session, and I've tried every imaginable setting as a workaround, to no avail.
    Is this a firmware bug?  Or have I somehow missed an important setting?  Any insight will be greatly appreciated.

    I tried calling that IBM number, 1-800-426-7378 through Yahoo, and also through three other toll-free termination providers. If anyone wants to try it just put the below SIP numbers into Speed Dial memory slots in your ATA.
    [email protected]
    [email protected]
    *[email protected]
    The first one, voipmich, seems to connect to the same IVR menu as when calling through Yahoo Voice, and I heard the woman's voice. The last two, sipphone and sipbroker, both connected me to a different IVR menu, it had a man's voice and DTMF IVR control worked there.
    I thought it worth mentioning that IVR menu control did not work even when calling from a SPA2102 account configured with a Gizmo5.com account. Apparently, the IVR control issue is not only with Yahoo Voice.

  • Samsung Convoy 2 delayed answering

    recently got a Samsung Convoy 2 and am having some issues. The main thing is that if someone calls me, there is a 4 to 5 second delay before it actually connects and they can hear me. So most of the time I say "hello" and they didn't hear me because it hadn't connected and they miss what ever I said. I noticed that the screen also has a delay (as far as the time of the call starting up). Anybody have this issue and does anybody know how to fix that?

    If you are using the standard Verizon voicemail, then call in  via *86, choose option 4, Personal Options, then 3, Greeting, and follow the prompts to change your personal greeting.

  • Long login delay on SunRay clients

    I have a login problem for my Sun Ray clients.
    My environment is like this
    •     Solaris02 is the one of two broker servers running SRSS, VDI and SGD
    •     Solaris02 is the second of two broker servers running SRSS, VDI and SGD
    •     The Solaris servers are virtual machines running 64Bit Solaris patched today with latest patches, 2 CPUs 3GB ram. The SRSS is version 4.1 the bundled version from VDI 3.0 and the SGD is version 4.41
    •     The VDI is connecting to a vCenter server that serves XP clients SP3 with VDI client
    When a SunRay client boots, or the user presses the shutdown X on the top dropdown in the MS Windows session. Then the SunRay reconnects to the Solaris server it comes from. Or the one it gets
    If the SunRay client connects to Solaris02 the wait from getting an IP and connect to the Solaris VDI client is up to 5-10 minutes.
    If the SunRay client connects to Solaris03 the wait time is 5-10 seconds
    I have tried renaming the /usr/dt/lib/dtobsolete file from the SRSS release notes “Multihead CDE Kiosk Sessions (Bug ID 6645931)” this changed nothing:o(
    Thanks in advance
    /Nicolai

    Well yes, that just avoids the issue by preventing start-pulseaudio-x11 from starting. I'll try that workaround until a real solution shows up. Thanks for your reply.
    I'll try this patch from Ubuntu quantal does not seem to work:
    From b4389a752385afd6e65e412a8488828ee3648fbd Mon Sep 17 00:00:00 2001
    From: Zsolt Rizsanyi <[email protected]>
    Date: Sun, 27 Jun 2010 15:16:13 +0100
    Subject: [PATCH 2/2] In KDE only start pulseaudio from the KDE specific desktop file
    src/daemon/pulseaudio.desktop.in | 1 +
    1 files changed, 1 insertions(+), 0 deletions(-)
    diff --git a/src/daemon/pulseaudio.desktop.in b/src/daemon/pulseaudio.desktop.in
    index 99bdbd0..47b2eb4 100644
    --- a/src/daemon/pulseaudio.desktop.in
    +++ b/src/daemon/pulseaudio.desktop.in
    @@ -6,5 +6,6 @@ _Comment=Start the PulseAudio Sound System
    Exec=start-pulseaudio-x11
    Terminal=false
    Type=Application
    +NotShowIn=KDE;
    Categories=
    GenericName=
    Creating an empty ~/.config/autostart/pulseaudio.desktop overrides the one in /etc/xdg/ and seems to work.
    Last edited by Lekensteyn (2012-09-16 22:21:58)

  • My typing is significantly delayed answering emails

    Significant delay in typing anything whenever answering an email.

    Hi. We noticed that the troubleshooting information was missing from these questions. In order to better investigate this issue, we may need to request a little more non-personal information.
    Please add the troubleshooting information to your post as well as the results of the following troubleshooting steps:
    * [https://support.mozilla.org/kb/use-troubleshooting-information-page-fix-firefox#w_accessing-the-troubleshooting-information-page Finding the Troubleshooting information]
    *Does Thunderbird work in TB Safe mode (see [http://mzl.la/1k5DWjq Thunderbird Safe Mode])?
    *What is the Thunderbird version?
    *What operating system do you use (e.g. Windows 7)?
    *Do you use anti-virus and firewall software? What is the version?
    *Do you use Thunderbird add-ons?
    *Who is the email provider?
    *Who is the internet provider?
    *What is the exact error message?
    *What steps did you take right before this happened?
    With this information we can better investigate and get a better idea of what may be causing the issue.
    Please post back with this information and any other questions you might have.

  • Blocking FTP connections for specific clients

    Hi. My core switch has 2 vlan interfaces, vlan85 for users and vlan100 for servers. I would like to allow a few certain IPs from vlan85 users to my FTP server. Can this be done without actually needing to define access to all the other services (my users need access other machines using ssh, telnet, web etc.)
    Thanks.

    Okay well that's a bit of worry as Cisco doc for blocking ftp shows both ports being blocked
    http://www.cisco.com/en/US/tech/tk648/tk361/technologies_configuration_example09186a0080100548.shtml#denyftp
    So follow their example and fail the lab !.
    Point i was trying to make was that we aren't taking a lab. May not be necessary but won't do any harm either.
    Anyway lets not get into an argument about it. The access-list will work whether port 20 is included or not and there will be no adverse effects whichever the original poster uses.
    Jon

  • Issue with Ftp Client / Server using Sockets

    I have developed a Ftp Client and a Ftp Server. The client Connects to the Ftp Server and sends files to the ftp server. It is a multi threaded server and can have multiple clients connecting to it.
    If a client goes down...the server waits till the client comes up
    Similarly the client waits if a server goes down and reconnects when the server is again up and running
    i am having a strange issue here. When two clients go down and reconnect to the server...They take a long time to connect and transferring of files takes a long time...
    Other wise in all other scenarios the duo work properly.
    Any feedback and suggestion about this strange issue from all you java gurus out there will be deeply appreciated.
    Here is the client code
    import java.net.*;
    import java.net.Socket;
    import java.net.InetAddress;
    import java.io.*;
    import java.io.File;
    import java.util.*;
    import java.lang.*;
    import java.lang.Object;
    import javax.crypto.*;
    import java.util.regex.*;
    import javax.crypto.spec.PBEKeySpec;
    import javax.crypto.spec.PBEParameterSpec;
    import java.security.spec.AlgorithmParameterSpec;
    import java.security.spec.KeySpec;
    import java.io.InputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.File.*;
    import java.nio.channels.FileLock;
    public class  FTPClient {
         public static void main(String[] args) throws Exception
              Timer timer = new Timer("Test Timer");
              timer.scheduleAtFixedRate(new TimerTask()
                   private int counter = 0;
                                            public void run() {
                                                                     try     {                                                                                
                                                                              System.out.println(counter++);
                                                                               Socket soc=new Socket("xxx.x.x.xx",5217);
                                                                               System.out.println("Socket Initialised.");          
                                                                               transferfileClient t=new transferfileClient(soc);
                                                                               t.SendFile();
                                                                               System.out.println("run complete.");                                                                           
                                                                          catch(Exception ex)
                                                           }, 10000, 40000);
         static class transferfileClient
         Socket ClientSoc;
         DataInputStream din;
         DataOutputStream dout;
         BufferedReader br;
         transferfileClient(Socket soc)
              try
                   ClientSoc=soc;
                   din=new DataInputStream(ClientSoc.getInputStream());
                   dout=new DataOutputStream(ClientSoc.getOutputStream());
                   br=new BufferedReader(new InputStreamReader(System.in));
              catch(Exception ex)
         //encrypto routine starts
    class DesEncrypter {
           Cipher ecipher;
            Cipher dcipher;   
            // 8-byte Salt
            byte[] salt = {
                (byte)0xA9, (byte)0x9B, (byte)0xC8, (byte)0x32,
                (byte)0x56, (byte)0x35, (byte)0xE3, (byte)0x03
            // Iteration count
            int iterationCount = 19;   
            DesEncrypter(String passPhrase) {
                try {
                             // Create the key
                             KeySpec keySpec = new PBEKeySpec(passPhrase.toCharArray(), salt, iterationCount);
                             SecretKey key = SecretKeyFactory.getInstance(
                             "PBEWithMD5AndDES").generateSecret(keySpec);
                             ecipher = Cipher.getInstance(key.getAlgorithm());
                             dcipher = Cipher.getInstance(key.getAlgorithm());   
                             // Prepare the parameter to the ciphers
                             AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);   
                             // Create the ciphers
                             ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
                             dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
                } catch (java.security.InvalidAlgorithmParameterException e) {
                } catch (java.security.spec.InvalidKeySpecException e) {
                } catch (javax.crypto.NoSuchPaddingException e) {
                } catch (java.security.NoSuchAlgorithmException e) {
                } catch (java.security.InvalidKeyException e) {
            // Buffer used to transport the bytes from one stream to another
            byte[] buf = new byte[1024];   
            public void encrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes written to out will be encrypted
                    out = new CipherOutputStream(out, ecipher);   
                    // Read in the cleartext bytes and write to out to encrypt
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
            public void decrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes read from in will be decrypted
                    in = new CipherInputStream(in, dcipher);   
                    // Read in the decrypted bytes and write the cleartext to out
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
    }     //encryptor routine ends     
         void SendFile() throws Exception
                   try
                   String directoryName; 
                   // File object referring to the directory.
                   String[] files;        // Array of file names in the directory.        
                   //directory = new File ( "C:\\FTP\\" ) ; 
                   File directory1 = new File("C:\\FTP");
                        boolean successmk = directory1.mkdir();
                        if (!successmk) {
                             // Directory creation failed /Already Exists
                        File directory = new File("C:\\FTP\\ftpc");
                        boolean successmk1 = directory.mkdir();
                        if (!successmk1) {
                             // Directory creation failed /Already Exists
                   //directory = new File ( "E:\\FTP-encrypted" ) ;           
                if (directory.isDirectory() == false) {
                    if (directory.exists() == false)
                       System.out.println("There is no such directory!");
                    else
                      System.out.println("That file is not a directory.");
                else {
                    files = directory.list();
                    System.out.println("Files in directory \"" + directory + "\":");
                    for (int i = 0; i < files.length; i++)
                             String patternStr = "xml";
                             Pattern pattern = Pattern.compile(patternStr);
                             Matcher matcher = pattern.matcher(files);
                             boolean matchFound = matcher.find();
                                       if (matchFound) {                                   
                                       System.out.println(" " + files[i]);                                        
                                       String filename;
                                       filename=files[i];                                   
                                       File f=new File(directory,filename);
                                       FileLock lock = null;                                   
                                       FileOutputStream fos = new FileOutputStream(f, true);
                                       lock = fos.getChannel().tryLock();
                                                 if (lock == null) {
                                                 System.out.println(" Failed to get the file lock: means that the file is locked by other instance.");
                                                 fos.close();
                                                 else
                                                                     InetAddress addr = InetAddress.getLocalHost();                                                                      
                                                                               // Get IP Address
                                                                               //byte[] ipAddr = addr.getAddress();
                                                                               String ip= addr.toString();                                                                      
                                                                               // Get hostname
                                                                               //String hostname = addr.getHostName();
                                       System.out.println(" Lock Acquired.");
                                       lock.release();
                                       fos.close();
                                       dout.writeUTF("SEND");
                                            dout.writeUTF(ip);
                                       dout.writeUTF(filename);
              //String msgFromServer=din.readUTF();          
    DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
    // Encrypt
              FileInputStream fino=new FileInputStream(f);
              encrypter.encrypt(fino,
    new FileOutputStream("ciphertext.txt"));               
              fino.close();
              FileInputStream fin=new FileInputStream("ciphertext.txt");          
              int ch;
              do
                   ch=fin.read();
                   dout.writeUTF(String.valueOf(ch));
              while(ch!=-1);
              fin.close();          
              String option;
                        option=din.readUTF();
                             if((option.compareTo("Delete")==0))     
                                  boolean success = (new File("ciphertext.txt")).delete();
                                  boolean success1 = f.delete();
                                  if (success) {
                                  System.out.println("File Sent ...");
                                  if (success1) {
                                  System.out.println("--File deleted from Client ...");
         for (int j = 0; j < 999999999; j++){}
                                       }//pattermatch loop ends here
    else
                             { //System.out.println("   " + "Not an XML file-------->" +files[i]);
    for (int jb = 0; jb < 111999999; jb++){}
              }// for loop ends here for files in directory
                   }//else loop ends for directory files listing               
         System.out.println("sendfile finished...");
         return;
         }               catch(Exception ex)          {ex.printStackTrace();}                    
         }//sendfile ends here     
         public void displayMenu() throws Exception
                   System.out.println(" Send File");                    
                        SendFile();
                        return;          
    And here is the server code...
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    import java.text.DateFormat;
    import java.text.Format;
    import java.lang.Object;
    import java.lang.*;
    import javax.crypto.*;
    import javax.crypto.spec.PBEKeySpec;
    import javax.crypto.spec.PBEParameterSpec;
    import java.security.spec.AlgorithmParameterSpec;
    import java.security.spec.KeySpec;
    public class FTPServer
    {     public static void main(String args[]) throws Exception
         {     ServerSocket soc=new ServerSocket(5217);
              System.out.println("FTP Server Started on Port Number 5217");
              while(true)
                   System.out.println("Waiting for Connection ...");
                   transferfile t=new transferfile(soc.accept());               
    class transferfile extends Thread
         Socket ClientSoc;
         DataInputStream din;
         DataOutputStream dout;     
         transferfile(Socket soc)
         {     try
              {     ClientSoc=soc;                              
                   din=new DataInputStream(ClientSoc.getInputStream());
                   dout=new DataOutputStream(ClientSoc.getOutputStream());
                   System.out.println("FTP Client Connected ...");
                   System.out.println("External IP of Client ..." + ClientSoc.getInetAddress());
                   //System.out.println("FTP Client Connected ..." + ClientSoc.getRemoteSocketAddress());
                   start();               
              catch(Exception ex)
    //encrypto routine starts
    class DesEncrypter {
            Cipher ecipher;
            Cipher dcipher;   
            // 8-byte Salt
            byte[] salt = {
                (byte)0xA9, (byte)0x9B, (byte)0xC8, (byte)0x32,
                (byte)0x56, (byte)0x35, (byte)0xE3, (byte)0x03 };   
            // Iteration count
            int iterationCount = 19;   
           DesEncrypter(String passPhrase) {
                try {
                    // Create the key
                    KeySpec keySpec = new PBEKeySpec(passPhrase.toCharArray(), salt, iterationCount);
                    SecretKey key = SecretKeyFactory.getInstance(
                        "PBEWithMD5AndDES").generateSecret(keySpec);
                    ecipher = Cipher.getInstance(key.getAlgorithm());
                    dcipher = Cipher.getInstance(key.getAlgorithm());   
                    // Prepare the parameter to the ciphers
                    AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);   
                    // Create the ciphers
                    ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
                    dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
                } catch (java.security.InvalidAlgorithmParameterException e) {
                } catch (java.security.spec.InvalidKeySpecException e) {
                } catch (javax.crypto.NoSuchPaddingException e) {
                } catch (java.security.NoSuchAlgorithmException e) {
                } catch (java.security.InvalidKeyException e) {
            // Buffer used to transport the bytes from one stream to another
            byte[] buf = new byte[1024];   
            public void encrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes written to out will be encrypted
                    out = new CipherOutputStream(out, ecipher);   
                    // Read in the cleartext bytes and write to out to encrypt
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
            public void decrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes read from in will be decrypted
                    in = new CipherInputStream(in, dcipher);   
                    // Read in the decrypted bytes and write the cleartext to out
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                        //added later on
                        in.close();                    
                    out.close();
                } catch (java.io.IOException e) {
    }     //encryptor routine ends
    //not implemented right now as we arent using the ftp server to download stuff...can be activated later on if we want
         void SendFile() throws Exception
              String filename=din.readUTF();
              File f=new File(filename);
              if(!f.exists())
                   dout.writeUTF("File Not Found");
                   return;
              else
              {     dout.writeUTF("READY");
                   FileInputStream fin=new FileInputStream(f);
                   int ch;
                   do
                        ch=fin.read();
                        dout.writeUTF(String.valueOf(ch));
                   while(ch!=-1);     
                   fin.close();     
                   dout.writeUTF("File Received Successfully");                                   
         String Compare(String filename) throws Exception
                        ///dout.writeUTF("entering compare");
                        String dateTempString=new String();
                        Date dateValue=new Date();
                        SimpleDateFormat formatter = new SimpleDateFormat ("hhmmss");
                        dateTempString = formatter.format(dateValue);
                        File dir1 = new File("C:\\FTPnew");
                        boolean success2 = dir1.mkdir();
                        if (!success2) {
                             // Directory creation failed /Already Exists
                        File dir = new File("C:\\FTPnew\\server");
                        boolean success = dir.mkdir();
                        if (!success) {
                             // Directory creation failed /Already Exists
                        File ftemp=new File(dir,dateTempString + filename);
                        File fnewtemp=new File(dir,"new-enc-"+filename);
                        // Create encrypter/decrypter class
                        DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
                        FileOutputStream fout=new FileOutputStream(fnewtemp);     
                        int ch;
                        String temp;
                        do
                        {     temp=din.readUTF();
                             ch=Integer.parseInt(temp);
                             if(ch!=-1)
                                  fout.write(ch);                         
                        }while(ch!=-1);
                        fout.close();
                        //dout.writeUTF("written temp en file");
                        // Decrypt
                    encrypter.decrypt(new FileInputStream(fnewtemp),
                    new FileOutputStream(ftemp));
                        //String Option;
                        dout.writeUTF("Delete");                    
                        System.out.println("File Upload Successfull--Duplicate file with timestamp Created");          
                        boolean success1 = fnewtemp.delete();                    
                        return "hello" ;
         void ReceiveFile() throws Exception
              String ip=din.readUTF();
              System.out.println("\tRequest Coming from Internal IP Address : "+ ip);
              String filename=din.readUTF();
              if(filename.compareTo("File not found")==0)
                   return;
              // Destination directory
       File dir11 = new File("C:\\FTPnew");
                        boolean success22 = dir11.mkdir();
                        if (!success22) {
                             // Directory creation failed /Already Exists
                        File dir = new File("C:\\FTPnew\\server");
                        boolean success21 = dir.mkdir();
                        if (!success21) {
                             // Directory creation failed /Already Exists
              File f=new File(dir ,"enc-"+filename);
              File fe=new File(dir,filename);
              String option;
              if(fe.exists())
                   //dout.writeUTF("File Already Exists");
                   String compvalue = Compare(filename);
                   //dout.writeUTF(compvalue);
                   if(compvalue.compareTo("hello")==0)
                        //dout.writeUTF("Transfer Completed");
                        return;
                   option=din.readUTF();
              else
                   //dout.writeUTF("SendFile");
                    option="Y";
                   if(option.compareTo("Y")==0)
                        // Generate a temporary key.       
            // Create encrypter/decrypter class
             DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
                 FileOutputStream fout=new FileOutputStream(f);                    
                        int ch;
                        String temp;
                        do
                        {     temp=din.readUTF();
                             ch=Integer.parseInt(temp);
                             if(ch!=-1)
                                  fout.write(ch);                         
                        }while(ch!=-1);
                        fout.close();                    
                        // Decrypt
                    encrypter.decrypt(new FileInputStream(f),
                    new FileOutputStream(fe));          
                        boolean success2 = f.delete();
                        dout.writeUTF("Delete");
                        System.out.println("File Upload Successfull");                    
                   else
                        return;
         public void run()
              while(true)
                   try
                   String Command=din.readUTF();
                   if(Command.compareTo("SEND")==0)
                        System.out.println("\tSEND Command Received ...");     
                        ReceiveFile();
                        continue;
                   catch(Exception ex)
                        //System.out.println("\tClient Terminated Abnormally ...........");
                        continue;

    Please note that this is not an FTP client and server. FTP is defined by a standard IETF protocol and this isn't it.
    Then, move the following lines:
    din=new DataInputStream(ClientSoc.getInputStream());
    dout=new DataOutputStream(ClientSoc.getOutputStream());
    System.out.println("FTP Client Connected ...");
    System.out.println("External IP of Client ..." + ClientSoc.getInetAddress());
    //System.out.println("FTP Client Connected ..."+ClientSoc.getRemoteSocketAddress());from the constructor into the run() method. i.e. don't do anything with the socket in the thread which handles the accept().

  • Coding a FTP-client with a special feature

    Hi!
    I have a project in school where we are supposed to pick our own project that we code in java, and it has to be involved around networking. So I thought to myself that I should try to code a basic ftp client. This I don't see as a problem since there are a nice API for this, but there is however a glitch that I'm currently researching.
    The special feature in my client is segment downloading. Enabling this feature will let loose 3-4 threads that will connect with the original login/pass and split the desired file in 3-4 parts so they all can download it at the same time. Does anyone got hints how I can accomplish this little task of splitting a file?
    Any help would be GREATLY appreciated!
    //Frank

    Thanks for trying to help me with this. I just found a little info that might be useful that seems to proove that it's not a server-side matter: http://www.codeproject.com/KB/IP/MyDownloader.aspx
    A little down on that page you can find this:
    "Downloads can be segmented because both HTTP and FTP protocols allow the client to specify the start position of the stream. First, MyDownloader performs a request to the server to discover the file size. After that, MyDownloader calculates the segment size as follows:
    segment size = min( (file size / number of segments),
    minimum allowed segment size )
    With the segment size, MyDownloader creates another request specifying the start position of the stream. In this way, we can have multi-requests for the same files running in parallel using multi-threading techniques. This technique speeds up the transfer rate even more if you are using mirrors."
    Gotta read up to see if there is a way to apply this thinking in java.

  • XI as FTPS client

    We have the digital certificate from our client. We will be polling their server (FTPS server) for the file. I guess all we need to do is to LOAD this digital certificate in Keystore service via VA and then to use this in comm channel, right?
    Thanks,
    Pam

    Pam,
    What are you trying to do..Could you please be a bit clearer..
    You want to get a file from a client using the XI file adapter as ftp after authenticating the client using the certificate which they have provided.?
    If that is the case then you are good ...
    Regards
    Ravi Raman

  • HOw to connect FTP Client using flex

        Hi Everyone,
                   i am new to flex, i am developing one flex application, some one give example of connecting ftp client using flex. i didnot found any examples.
    thnx

    You would need to communicate with your ftp server over a socket and implement the ftp protocol on your client. The project below aims to do this, but I have never used it:
    http://maliboo.riaforge.org/
    Why not download over http (and save yourself a lot of time)?

  • Delayed Call Answer Iphone 4

    This is something that's bugged me since I first got my Iphone 4....every time I make or receive a call, as soon as I answer the phone, there is a 1 to 2 second delay until the other person can hear me. This results in me having to say hello 2 or 3 times before I get a response from the other end. Does anyone else have a problem with a 1-2 second delayed answer when making or receiving calls on the Iphone 4?

    Visual voicemail is delivered over the cellular data network and is controlled by the network, not the phone. Delays are caused by network problems.
    However, if your phone is located in a very weak signal area, delivery may be delayed until a better signal is recieved

  • Can an LDAP server be it's own client?

    In short yes, why would you want to do this? Many reasons, but mine is to be able to use ldap on laptops running Solaris and have them log into the machine with ldap credentials off the network. When we plug them back onto the network, I have a master server send any new data via one-way replication. I will give 2 separate ways to accomplish this. One is, to put it bluntly, a dirty hack to get it working. The second is much more elegant and it's the one I have stressed tested to verify that it works.
    Disclaimer: I have only used these methods on Solaris10 update 3 with Trusted Extensions using directory server 5.2 as well as the administration server. I have used a few different kinds of machines (all x86) and have not had a problem with it. I do not know if it will work on any other version or hardware. I haven't even looked at the source code, all assumptions made here are from observing the systems behavior while making minor changes.
    Now, the reasons why normally you can't be your own client (at least as far as I can tell) is because of the way the system boots and the dependencies that the ldap/client service needs to start up. If you boot a machine that is it's own client and ldap/client runs before the directory server starts, of course it will fail. The system boots the services first, then legacy init scripts. Directory Server 5.2 uses init scripts. Correct me if I am wrong, but that is the only real hurdle in your way.
    So the first way to get it 'working' (dirty hack) is to delay the ldap/client smf service from starting until the directory server is started. After you become a client of yourself (in this case the global zone) disable the ldap/client serrvice.
    svcadm disable ldap/clientThen enable it temporarily with the -t option
    svcadm enable -t ldap/clientWell if you were to reboot now it would not work because the service would not start at boot because it is set to be administratively down. Edit the S72directory script in /etc/rc2.d and after the start commands just add the svcadm enable -t ldap/client command and it will load right after directory server starts. Will this work? Yes, is it a clean way to do it? NO. I used this method just for testing the theory that the only reason I could not be my own client was because of the booting issue.
    Now the best way that I can see to accomplish this is to create your own smf services for the directory server and admin server. That way all you have to do is add a dependency to the ldap/client xml file to wait until the new directory server service is started before it starts. So in /var/svc/manifest/site create a folder called ldap (I put this in site because I didn't want to run into any issues of patching). In /var/svc/manifest/site/ldap/ create two xml files named:
    quick note: These are the first services I have created. There may be a much better way to make them. If you can re-code it better, please let me know so I can look at them. Also there is no restart command in here (actually I just noticed that) so adding one of those would be wise.
    ds_admin.xml and directory_server.xml.
    ds_admin.xml contains<?xml version="1.0"?>
    <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
    <!--
         Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
         Use is subject to license terms.
         ident     "@(#)client.xml     1.4     04/12/09 SMI"
         NOTE:  This service manifest is editable; its contents will not
         be overwritten by package or patch operations, including
         operating system upgrade.
    -->
    <service_bundle type='manifest' name='SUNWdsadmin:dsadmin'>
    <service
         name='site/ldap/ds_admin'
         type='service'
         version='1'>
         <create_default_instance enabled='false' />
         <single_instance />
         <dependency
             name='fs'
             grouping='require_all'
             restart_on='none'
             type='service'>
              <service_fmri value='svc:/system/filesystem/minimal' />
         </dependency>
         <dependency
             name='net'
             grouping='require_all'
             restart_on='none'
             type='service'>
              <service_fmri value='svc:/network/initial' />
         </dependency>
         <exec_method
             type='method'
             name='start'
             exec='/lib/svc/method/ds_admin start'
             timeout_seconds='120' >
              <method_context>
                   <method_credential user='root' group='sys' />
              </method_context>
         </exec_method>
         <exec_method
             type='method'
             name='stop'
             exec='/lib/svc/method/ds_admin stop'
             timeout_seconds='60' >
              <method_context>
                   <method_credential user='root' group='sys' />
              </method_context>
         </exec_method>
         <stability value='Unstable' />
         <template>
              <common_name>
                   <loctext xml:lang='C'>
                   LDAP Admin server      
                   </loctext>
              </common_name>
              <description>
                   <loctext xml:lang='C'>
    LDAP admin server
    Information Service lookups
                   </loctext>
              </description>
         </template>
    </service>
    </service_bundle>and directory_server.xml contains:
    <?xml version="1.0"?>
    <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
    <!--
         Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
         Use is subject to license terms.
         ident     "@(#)client.xml     1.4     04/12/09 SMI"
         NOTE:  This service manifest is editable; its contents will not
         be overwritten by package or patch operations, including
         operating system upgrade.
    -->
    <service_bundle type='manifest' name='SUNWds:ds'>
    <service
         name='site/ldap/directory_server'
         type='service'
         version='1'>
         <create_default_instance enabled='false' />
         <single_instance />
         <dependency
             name='usr'
             grouping='require_all'
             restart_on='none'
             type='service'>
              <service_fmri value='svc:/system/filesystem/minimal' />
         </dependency>
         <dependency
             name='net'
             grouping='require_all'
             restart_on='none'
             type='service'>
              <service_fmri value='svc:/network/initial' />
         </dependency>
      <dependency
                name='ds_admin'
                grouping='require_all'
                restart_on='none'
                type='service'>
                    <service_fmri
                        value='svc:/site/ldap/ds_admin' />
         </dependency>
         <exec_method
             type='method'
             name='start'
             exec='/lib/svc/method/directory_server start'
             timeout_seconds='120' >
              <method_context>
                   <method_credential user='root' group='sys' />
              </method_context>
         </exec_method>
         <exec_method
             type='method'
             name='stop'
             exec='/lib/svc/method/directory_server stop'
             timeout_seconds='60' >
              <method_context>
                   <method_credential user='root' group='sys' />
              </method_context>
         </exec_method>
         <stability value='Unstable' />
         <template>
              <common_name>
                   <loctext xml:lang='C'>
                   LDAP directory server      
                   </loctext>
              </common_name>
              <description>
                   <loctext xml:lang='C'>
    LDAP directory server
    Information Service lookups
                   </loctext>
              </description>
         </template>
    </service>
    </service_bundle>Now the start/stop scripts will be located in /lib/svc/method and are as followed:
    ds_admin
    #!/sbin/sh
    case "$1" in
         start)
              /usr/sbin/directoryserver start-admin
         stop)
              /usr/sbin/directoryserver stop-admin
              echo "Usage: $0 { start | stop }"
              exit 1
    esac
    exit 0simple yes.
    directory_server
    #!/sbin/sh
    HOST_NAME=`hostname`
    SERVER_ROOT=/var/opt/mps/serverroot
    DIRECTORY_SERVER_INSTANCE=slapd-${HOST_NAME}
    case "$1" in
         start)
              ${SERVER_ROOT}/${DIRECTORY_SERVER_INSTANCE}/start-slapd
         stop)
              ${SERVER_ROOT}/${DIRECTORY_SERVER_INSTANCE}/stop-slapd
              echo "Usage: $0 { start | stop }"
              exit 1
    esac
    exit 0The only thing left to do is modify the ldap/client smf file to wait until the directory server starts before it loads.
    So edit /var/svc/manifest/network/ldap/client.xml and right before the dependency for for /var/ldap/ldap_client_file add this
    <dependency
                name='directory_server'
                grouping='require_all'
                restart_on='none'
                type='service'>
                    <service_fmri
                            value='svc:/site/ldap/directory_server' />
            </dependency>
    Any changes made to the /ldap/client xml file must be made after ALL zones have been installed. If this file is copied to a zone it will never work as the directory_server service is not loaded in the zones.
    Now what? You must remove the legacy init scripts in /etc/rc2.d. Those would be S72directory and S73mpsadm. No need to keep them around, alternatively, you can just change the capital 'S' to lower case and they want start.
    You can now either use svccfg to validate and import the new services or you can reboot. Typically, I reboot and use the '-m verbose' option on boot to watch the services for any errors. I haven't had any lately but on different systems I always watch to see if it behaves different.
    That's it. I have rebooted all the machines many, many times without error. This of course does not address loading the directory server or adding users, tnrhdb file, etc... We have scripted most of loading out and once we get some error correction coded in I will post them.
    Also, if you find any errors or even a better way to accomplish this, please post it.

    This restriction is only in terms of implementing the Solaris support for LDAP as a naming service. If the Solaris OS is configured to use LDAP as a naming service, it can't use a LDAP server running on the same host.
    The reason is that the LDAP server makes naming service calls before it gets fully started up. If the OS wants to use the LDAP server for the naming service, then a deadlock happens, where the LDAP server's gethostbyname() call can't complete because the LDAP server isn't up.
    It is possible to configure the Solaris naming resolution to avoid this problem. I've got a system set up this way myself. Regardless, the official support channels won't support a system set up this way, so if you do this you do it at your own risk.

  • 10g - disconnected analytics, encrytion on csv file in client machine

    hi, experts,
    I found that the disconnected analytics client firstly download the data from server and SAVED AS CSV FILES.
    but everyone can view the content in csv files.
    IT IS UNSAFE.
    can any encrytion be done for this issue?
    Thank you very mucH!

    user11861756 wrote:
    I am trying to get a csv file in the client machine .My database server is configured in oracle 10g within an unix
    box.Though i am able to get a csv file on my server by using pl/sql codes and can have it on my local machine by
    ftp.But the problem is we dont have any permission to create ant file in our production environment .
    Is there is any process or utility on which i can build on my previous approach to get my csv file on my client
    machine directly.
    The answer to this question is the question.. What is client-server?*
    PL/SQL, SQL, Oracle, database ... all these equal server.
    SQL*Plus, TOAD, web browsers... all these equal client.
    Who handles the presentation of data on the client? Who has access to the client platform's keyboard, mouse, screen printer, disk drives, etc? The client.
    So how can a server process or component then hack across the client-server architecture and into a client component and write data (e.g. CSV files) there?
    This is a fundamental concept that needs to be clearly understood when dealing with all aspects of client-server.
    What also needs to be understood that client-server is a software architecture. This means that client-server can run on a single machine. Client can run on a PC. Server can run on a big Unix machine. Or server can run on the PC and the client can run on the big Unix machine.
    Which means that you can have PL/SQL code (on the server platform) acting as a client.. and use server software on your client platform to service that PL/SQL session.
    For example. PL/SQL creates a CSV "+file+" as a CLOB. PL/SQL uses a FTP package and opens a client FTP session to a FTP server on your client PC. Now your PC is the FTP server and PL/SQL the FTP client. The client then proceeds to FTP the CLOB as a CSV file.

Maybe you are looking for

  • No 3d option in Photoshop CC or CS6

    Hi there, tying to do some 3d text but the 3d button is not there and the 3d drop down menu is all greyed out any ideas? Please Help Adobe Photoshop Version: 14.1.1 (14.1.1 20130910.r.414 2013/09/10:23:00:00) x32 Operating System: Windows 7 64-bit Ve

  • Function in component in tilelist in flex

    i am taking 4 hardcoded images from an xml file in flex tilelist component and i just want to drag and drop one image from tilelist to another but i am unable to call mousemove function in component of tilelist

  • IChat defaults to audio

    I'm using iSight with OS 10.4.3 on a G5 iMac and iChat. Every other day or so I find that my buddy list shows for me only the audio symbol, not the video camera. The solution is to unplug the iSight and plug it back in -- then it works fine for a day

  • Frozen in disk mode

    My headphones broke and I didnt use my ipod nano for about a month then i bought some new ones and when I tried to put new songs on the ipod it keeps telling me I need to re configure it or something I finally got it to work and i got more songs and

  • Batch-Input Dynpro sequence changed

    Hello, a customer uses a report since today (1 1/2 years) that creates new materials by CALL TRANSACTION 'MMZ1'. Hoever, the once recorded dynpro sequence changed and the report fails to create new materials. (already changed and material creation wi