Java Server / c++ Client

Hi !
I am trying to do a simple application to send strings between java Server and a c++ client,
I can do the whole thing in java, but no much experience in c++. (I guess it is no necessary to use CORBA)
Do you know where I can get some information about this ?
Thanks.

you do not need to use CORBA, though that is one way to get two processes to communicate, there are many others.
I would suggest using sockets. Take a look at the java.net package in particular, java.net.ServerSocket for your server. For the client it depends on the OS you want to run it under. For UNIX, I would recommend looking at a copy of UNIX network programming by W. Richard Stevens, but to summarize, you will need to use the connect system call (most likley defined in /usr/include/net/socket). I know there are similar system calls for Wintendo, but I dont know what they are called (my guess is WinFileHandle ConnectWin32( 500 arguments.......)), but searching the Wintel docs for Connect and Socket should get you there

Similar Messages

  • Soap : java server / Vb client ?

    what kind of problems can occur if i develop an application based on soap protocol with a VB client and java server ( apache server web) ?

    Hi,
    Have u found any solution..???
    if yes please help me ..
    am trying for an application which can communicate over net between
    Solaris and Win NT. I am thinking of using SOAP for this communication.
    Solaris is going to post SOAP envelops using Java and WinNT is going to
    read these envelops using VB.
    but i want this communication to be secure.
    so, i would like to know
    1. Is SOAP the right technology for this
    2. Can SOAP envelops be made secure
    3. Do u have any other solution for this
    4. Can i send a entire file as an attachment/text with xml
    5. PLEASE : Can u provide me with sample code
    Kind regards
    Sachin

  • Data transfer between C client and Java server

    Hello there
    I am working on a project where I have to develop a Client based on C and Server based on Java. The client can connect to Java server and it then sends a integer/string to Java server. But.. Java server unable to receive that and throws an IOException.
    I use write method to send the integer buffer to the socket.
    int out_buffer = 0;
    int *pbuf;
    pbuf = &out_buffer;
         if (write(acskfd, pbuf, 4)< 0){
                   syslog(LOG_ERR,"Write failed. %s(%d)", strerror(errno), errno);
                   printf("\tCLIENT:\tWrite failed\n");
                   exit(1);
    In Java, i use DatainputStream and readnInt method to read the integer from the stream.
    cl_sock = socket_out.accept();
    DataInputStream sInput =new DataInputStream(cl_sock.getInputStream()) ;
    int cmd = sInput.readInt();
    Am I missing someting.. Any suggestions would be really really helpful.
    Thanks
    Ithaca
    PS: I running both programs in the same machine.
    In C part, I also use host to network byte order conversion (serv_addr.sin_port = htons(portno).

    I would suggest writing a Java client to perform the same tasks as the C client.
    Then if the Java client does, or does not work this can help dteremine which end is at fault.
    Are you flushing your data from the client?

  • UDP DatagramPacket sent between C (client) and Java (server)

    Hi,
    I have a problem sending a struct from C to Java UDP server.
    In the C (client) program, the struct is defined as
    typedef strurct dataType_s {
    char name[52];
    char add[52];
    long x;
    long y;
    } dataType;
    dataType data;
    strcpy(data.name, "sun");
    strcpy(data.add, "com");
    data.x = 100;
    data.y = 50;
    sendto(sock, (struct dataType*)&dataType, sizeof(dataType), (struct sockaddr*)&dest, sizeof(dest))
    In the Java server side, I have the following code.
    byte[] buffer = new Byte[1024];
    DatagramPacket packet = new DatagramPacket(buffer, 1024);
    udpSock.receive(buffer);
    byte[] data = buffer.getData();
    String name = new String(data, 0, 52);
    String add = new String(data, 52, 52);
    String _xx = new String(data, 104, 4);
    String _yy = new String(data, 108, 4);
    Byte x = new Byte(xx.getBytes());
    long x = _x.longValue();
    Byte y = new Byte(yy.getBytes());
    long y = _y.longValue();
    I am having problem to read the contents of x and y above. The string name and add received by the server
    are correct. However, I receive garbage value
    for x (long) and y (long). In fact, I get expection
    that I cannot create Byte x and Byte y as shown
    above. Any idea of how to send a mixture of types
    from C/C++ to Java server?
    Thanks a lot.
    Kelvin ([email protected])

    sendto(sock, (struct dataType*)&dataType,
    sizeof(dataType), (struct sockaddr*)&dest,
    sizeof(dest))You have to check the alignment of your structs. You can't be sure that a long takes up four bytes. It can very well be 8 bytes or something else depending on your settings at compilation.
    udpSock.receive(buffer);
    byte[] data = buffer.getData();I suppose this is a typo, but of course you should use packet not buffer here.
    >
    Byte x = new Byte(xx.getBytes());
    long x = _x.longValue();
    Byte y = new Byte(yy.getBytes());
    long y = _y.longValue();
    in my opinion its easier to use a DataInputStream instead:
    DataInputStream in = new DataInputStream(new ByteArrayInputStream(data));
    int y = in.readInt();
    Notice that a long in Java is 8 bytes. A C long corresponds to a Java int.
    /Per-Arne

  • Java server and C# client

    Hallo,
    Please, Can you help me. I´m looking for Java server run on the Linux Debian.
    The Server in Java must be very good implementation (connect many client-500workstation).
    I have workstation ( Microsoft Windows XP, 7 ) and on the workstation must be client(in C#).
    The client say: a need information from Database and connecting to the Server in Java. The server in Java
    connect to the - Database(Oracle) and send information back to the workstation
    and workstation save as file.This is process before starting Windows, I need information
    for the starting script.
    For the Example, I have in databese name of instalation pack.
    Example implemention :
    On the workstation running agent.exe as service. I say in my script:
    (agent.exe -IdPack) and my agent connect to the Server and downloading information and save to the
    file(for example XML) in computer.
    Please, Do you know any solution?Any source code?project?
    I think, the server on the linux can be implementation in java servlet or next programming language.
    Thank You. Lukas

    Lukas-Firewall wrote:
    I´m administrator on the network. And we have information about computer in Oracle database. The information we need on the workstation windows and I need downloading from Database in Oracle and I need server which connect to the database and send back to the workstation the information. Do you understand me?So you have information in a database, and want some way of having that information accessible on Windows desktops? I don't see any need for C# clients here, surely a simple web app in a container like Tomcat will suffice? How complex is this information? In fact, so far I haven't seen any reason why you even need Java here. Can't you just throw some PHP at it? Where does C# come into the equation? Writing a custom rich client can often be avoided by using a web browser, especially if it's just a matter of taking some data from a DB and displaying it - makes your life much simpler.

  • Dns server and client in java

    Hello!
    Im trying to code a dns server and client in java.
    It`s supposed to be a very simple one. The server should just resolve the query, started from the client.
    Where can I find any code samples? It would really help me to get started.
    Thank you very much!
    Anne

    Do you have some code ?

  • Flash client communication with Java server

    I have written a Flash client in actionscript-3 and I have a Java server that is running locally using command prompt. I run the Flash app using Ctrl+Enter in Flash CS4 IDE and I am trying to receive some numbers from the server. I get the following message at trace output:
    Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: file:///C|/Documents%20and%20Settings/****/My%20Documents/CODE/FLASH/FlashApp/FlashApp.sw f cannot load data from localhost:12345.
    Why? What must i do to overcome this?
    Also when i publish the Flash app and use xampp to run a local web server and then use web browser to access FlashApp.html i also cannot receive any numbers from the java socket server that runs locally (on the same pc as the flash app does).

    Flash makes a request to the socket server automatically, if it doesn't get the proper response (a cross-domain XML document), then it won't connect.
    Here are a couple of links to get you started:
    http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7c60.html
    http://www.adobe.com/devnet/air/flex/quickstart/articles/communicating_with_sockets.html
    If you have questions after reviewing these articles, let me know.

  • Certificate Exception - applet client to java server with SSL

    Hi,
    I'm having some trouble getting SSL working and hope
    someone can shed some light. I've been plowing through
    these forums for a couple of days - seems lots of folks
    have had this problem but I can't find a clear solution.
    I've written a server in java. The client is an applet.
    This is an internet app so I have no control over
    configuring clients. I'm trying to prove SSL communication from the applet to my server. This is
    commercial software so the customer would put their own
    keys on the machine and resign the applet before deploying.
    I've created a keystore with keytool. Then I self-
    signed it. Then I signed my applet jarfile. I've even tried exporting the certificate and importing using the java plug-in control panel
    (obviously not something I can do in the real world but
    just wanted to see if that was it). I start up my server
    and navigate to a web page to start the applet. For
    development purposes, I'm doing this all on one machine. I'm running jdk 1.4.1_02. We're requiring the
    Sun plug-in as our client java VM.
    Once the client starts to connect, I get this error in
    the plug-in console:
    java.security.cert.CertificateException: Couldn't find trusted certificate
    On my server, I get:
    Wed May 14 16:27:46 EDT 2003 [EXCEPTION]: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
    javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
         at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
         at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.b(DashoA6275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA6275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
         at com.sun.net.ssl.internal.ssl.AppInputStream.read(DashoA6275)
         at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:406)
         at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:446)
         at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:180)
         at java.io.InputStreamReader.read(InputStreamReader.java:167)
         at java.io.BufferedReader.fill(BufferedReader.java:136)
         at java.io.BufferedReader.readLine(BufferedReader.java:299)
         at java.io.BufferedReader.readLine(BufferedReader.java:362)
         at com.pactolus.webBroker.psWebLegClientThread.run(psWebLegClientThread.java:130)
         at java.lang.Thread.run(Thread.java:536)
    The client code is pretty simple:
    SSLSocketFactory factory = (SSLSocketFactory)
        SSLSocketFactory.getDefault();
    tcpSocket = (SSLSocket) factory.createSocket(addr,
                                                 iPortNbr);
    tcpSocket.setUseClientMode(true);
    tcpSocket.startHandshake();followed by a thread kick-off which will listen on the
    socket for incoming messages.
    The server code is:
    SSLContext sslCtxt = SSLContext.getInstance("SSL");
    KeyManagerFactory kmf = KeyManagerFactory.getInstance
       ("SunX509");
    KeyStore ks = KeyStore.getInstance("JKS");
    char[] password = keyPassword.toCharArray();
    ks.load(new FileInputStream(keyFile), password);
    kmf.init(ks, password);
    sslCtxt.init(kmf.getKeyManagers(), null, null);
    SSLServerSocketFactory factory = 
        sslCtxt.getServerSocketFactory();
    secureTCPSocket = (SSLServerSocket)
        factory.createServerSocket(port);
    secureTCPSocket.setNeedClientAuth(false);followed by a thread kick-off which will listen for
    connections and spin-off other threads to manage each
    client socket.
    I'm pretty much at my wits end. As I said, seems lots of
    folks have had this problem but I haven't yet seen a
    firm answer.
    If anyone can shed some light on this so I can get my
    proof of conecept going, I would really appreciate it -and buy you a couple of beers!
    Thanks,
    Scott Johnson

    Problem resolved! It was the certificate. I can get it working in a test scenario by using the test certs file
    provided with the jdk on the client and server sides.
    So, does this mean that I MUST use a certificate from
    one of the known authorities as delivered with the JDK?
    My applet will be used by internet clients. I'm requiring
    the sun plug-in. Is it true there is no way to get
    a certificate I've created to be presented to the client
    so it can choose to add it to it's trusted authorities?
    I am required to use, say, a Verisign certificate?
    I can get my sample working but only if I place a
    jssecacerts (a copy of the samplecacerts) where both the client and server can get at it. In the real world, I can't do that on the client.
    Presumably the client will only have the cacerts that was delivered with the Sun plug-in. I'm restricted, then, to using a server key file signed with a certificate from
    one of the providers found in the cacerts file? Or, can
    I present to the client a certificate which it can
    choose to accept as trusted and place in it's cacerts file? Any info would be appreciated - I've already
    committed those duke bucks!
    Scott
    Hi,
    I'm having some trouble getting SSL working and hope
    someone can shed some light. I've been plowing
    through
    these forums for a couple of days - seems lots of
    folks
    have had this problem but I can't find a clear
    solution.
    I've written a server in java. The client is an
    applet.
    This is an internet app so I have no control over
    configuring clients. I'm trying to prove SSL
    communication from the applet to my server. This is
    commercial software so the customer would put their
    own
    keys on the machine and resign the applet before
    deploying.
    I've created a keystore with keytool. Then I self-
    signed it. Then I signed my applet jarfile. I've
    even tried exporting the certificate and importing
    using the java plug-in control panel
    (obviously not something I can do in the real world
    but
    just wanted to see if that was it). I start up my
    server
    and navigate to a web page to start the applet. For
    development purposes, I'm doing this all on one
    machine. I'm running jdk 1.4.1_02. We're requiring
    the
    Sun plug-in as our client java VM.
    Once the client starts to connect, I get this error
    in
    the plug-in console:
    java.security.cert.CertificateException: Couldn't find
    trusted certificate
    On my server, I get:
    Wed May 14 16:27:46 EDT 2003 [EXCEPTION]:
    javax.net.ssl.SSLHandshakeException: Received fatal
    alert: certificate_unknown
    javax.net.ssl.SSLHandshakeException: Received fatal
    alert: certificate_unknown
    at
    com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(Dasho
    6275)
    at
    com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.b(Dasho
    6275)
    at
    com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA627
    at
    com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA627
    at
    com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA627
    at
    com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA627
    at
    com.sun.net.ssl.internal.ssl.AppInputStream.read(Dasho
    6275)
    at
    sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDec
    der.java:406)
    at
    sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDeco
    er.java:446)
    at
    sun.nio.cs.StreamDecoder.read(StreamDecoder.java:180)
    at
    java.io.InputStreamReader.read(InputStreamReader.java:
    67)
    at
    java.io.BufferedReader.fill(BufferedReader.java:136)
    at
    java.io.BufferedReader.readLine(BufferedReader.java:29
    at
    java.io.BufferedReader.readLine(BufferedReader.java:36
    at
    com.pactolus.webBroker.psWebLegClientThread.run(psWebL
    gClientThread.java:130)
         at java.lang.Thread.run(Thread.java:536)
    The client code is pretty simple:
    SSLSocketFactory factory = (SSLSocketFactory)
    SSLSocketFactory.getDefault();
    tcpSocket = (SSLSocket) factory.createSocket(addr,
    iPortNbr);
    tcpSocket.setUseClientMode(true);
    tcpSocket.startHandshake();followed by a thread kick-off which will listen on
    the
    socket for incoming messages.
    The server code is:
    SSLContext sslCtxt = SSLContext.getInstance("SSL");
    KeyManagerFactory kmf = KeyManagerFactory.getInstance
    ("SunX509");
    KeyStore ks = KeyStore.getInstance("JKS");
    char[] password = keyPassword.toCharArray();
    ks.load(new FileInputStream(keyFile), password);
    kmf.init(ks, password);
    sslCtxt.init(kmf.getKeyManagers(), null, null);
    SSLServerSocketFactory factory = 
    sslCtxt.getServerSocketFactory();
    secureTCPSocket = (SSLServerSocket)
    factory.createServerSocket(port);
    secureTCPSocket.setNeedClientAuth(false);followed by a thread kick-off which will listen for
    connections and spin-off other threads to manage each
    client socket.
    I'm pretty much at my wits end. As I said, seems lots
    of
    folks have had this problem but I haven't yet seen a
    firm answer.
    If anyone can shed some light on this so I can get my
    proof of conecept going, I would really appreciate it
    -and buy you a couple of beers!
    Thanks,
    Scott Johnson

  • MFC Client cannot send message to a Java Server

    Hi All,
    I have a Java Server which listens on a TCP Socket. The client is a MFC based application and needs to communicate with the Server using simple raw text messages.
    We were able to connect to the Java Server using CSocket and CAsyncSocket objects but were not able to send messages.
    This is the code that we are trying:
    mySock = new CAsyncSocket(); // mySock is a CAsyncSocket object.,
    mySock->Create();
    mySock->Connect(strIP,lngPort);
    mySock->Send(strMessage, nSize);
    The server log shows that the connection is established, but the message doesnt reach.
    Please help !
    Thanks !!
    Sudhakar.

    I have the same problem.
    The Java (server) end is straightforward...
    Ian
    import java.io.*;
    import java.net.*;
    public class Serv extends Thread
         public static final int PORT = 3011;
         public static final String REQUEST = "REQUEST";
         /** Test */
         public static void main(String[] args)
              Serv s = new Serv();
              s.start();
         Serv()
              try
                   // Real code will set this class to be a daemon thread as we want it to stop is the main thread stops
                   //ss.setDaemon(true);
                   m_serverSocket = new ServerSocket(PORT);
              catch (IOException ex)
                   ex.printStackTrace();
         public void run()
              try
                   while (true)
                        // Launch a handler when a client connects:
                        final Socket clientSocket = m_serverSocket.accept();
                        ClientHandler clientHandler = new ClientHandler(clientSocket);
                        System.out.println("(Client " + clientHandler.getClientHostname() + " accepted on port " + PORT + ")");
                        clientHandler.start();
              catch (IOException ex)
                   ex.printStackTrace();
         private class ClientHandler extends Thread
              ClientHandler(Socket clientSocket)
                   try
                        setDaemon(true);
                        m_clientSocket = clientSocket;
                        m_socketWriter = new PrintWriter(new BufferedOutputStream(m_clientSocket.getOutputStream()));
                        m_socketReader = new BufferedReader(new InputStreamReader(m_clientSocket.getInputStream()));
                   catch (IOException ex)
                        ex.printStackTrace();
              public void run()
                   try
                        //m_socketWriter.println(getAlarmSummaryString());
                        //m_socketWriter.flush();
                        while (true)
                             final String request = m_socketReader.readLine();
                             System.out.println("Client request: " + request);
                             if (request.equals(REQUEST))
                                  m_socketWriter.println("RESPONSE");
                                  m_socketWriter.flush();
                             else
                                  m_clientSocket.close();
                                  break;
                   catch (SocketException ex)
                        System.out.println("(Client " + getClientHostname() + " disconnected)");
                   catch (IOException ex)
                        ex.printStackTrace();
              private String getClientHostname()
                   return ((InetSocketAddress)m_clientSocket.getRemoteSocketAddress()).getHostName();
              private Socket m_clientSocket;
              private PrintWriter m_socketWriter;
              private BufferedReader m_socketReader;
         private ServerSocket m_serverSocket;
    }

  • Managing stream between java server and c client

    Hi all
    I'm working on a client/server application.
    Client have been written in C
    Server is in Java.
    The client connect to the server, send a message (unknown size) and wait a response from the server.
    The server on connection start a new thread. This thread try to read data from the socket, using a BufferedInputStream :
    BufferedInputStream in = new BufferedInputStream(socket.getInputStream());
    As far as I dont know the size of the incoming message, i use the folowing algorythme to read data :
        byte[] bytesLus = new byte[1000];
        byte[] tmpBytesLus;
        byte[] tousLesBytes;int nb;
        i = 0;
        tousLesBytes = new byte[0];
        Log.trace(sourceTag,"Lecture des premiers octets");
        nb=in.read(bytesLus,0,bytesLus.length);
        Log.trace(sourceTag,nb+"octets lus");
        while (nb>0){                                                     
            tmpBytesLus = new byte[i+nb];
            System.arraycopy(tousLesBytes,0,tmpBytesLus,0,tousLesBytes.length);
            System.arraycopy(bytesLus,0,tmpBytesLus,tousLesBytes.length,nb);
            tousLesBytes = tmpBytesLus;
            i = i+nb;
            bytesLus = new byte[1000];
            Log.trace(sourceTag,"nb octets lus : " + i);
            if (in.available()>0)
                nb=in.read(bytesLus,0,bytesLus.length);
            else
                nb=0;
    This seemed (but only seemed - i will explain it later) to work fine :
    the client send a 6300 bytes sized msg. Server receive it, treat it and send response back. and this at each try.
    But when i change the log level of the server from TRACE to ERROR (wich have on consequence to accelerate the instruction Log.trace( ... ) the server doesn't work so fine !
    On first try, everything is ok, but on second, client send the same 6300 bytes msg, but server consider receiving only 3000 !
    After debbuging, i found why :
    the reason is the use of :
    if (in.available()>0)
    If you are reading faster than the writer, there is a moment where the stream is in a blocking state for the reader. and in.available return the number of bytes you can read before blocking...
    So my server consider that it reached the end of the message....
    So, after this long introduction, here my question :
    What is the best way to detect the end of a stream ?
    Should I send a special character on the stream and decode it on server ?
    Thank's for your advice.
    Olivier

    Generally, there are n ways of making sure an entire message of unknown size is recieved:
    1. Include some kind of validation criteria at the beginning of the message : checksum, bytecount, etc.
    2. Format the message such that the server can tell when the end is reached (subject to "line noise" problems)
    3. Enable two-way communication between the client and server, so they can work it out as they go.
    4. Use a pre-established protocol that handles all this for you
    5. Close the stream after writing if you only have one message.
    6. etc etc etc.

  • Setup Java system directory server 6 client for user authentication

    I am trying to set up a native LDAP client for sun directory server 6 for network based user authentication. I checked the sun doc for naming service (LDAP) and the documentation are for setting up LDAP client for directory server 5. Is there any documentation for setting up LDAP client for directory server 6? Or the documents for setting LDAP client for directory server 5 is still good for 6? Particularly, I want to use SSL communication between server and client.

    Hi,
    could be one of the other 'bad jokes' of DS/ldapclient because the documentation describes a lot of stuff about profiles etc. but: you need some special schema files to use the whole stuff and they are not installed with Solaris or DS (and they include the NisDomainObject). I had to search for them in the internet. They are also printed in the documentation. Save them in your server's config/schema directory as i.e. 61DUAConfigProfile.ldif and 62nisDomain.ldif and try idsconf again (maybe you have to cleanup something).
    I test and prepare DS6 here, and we will use it in production too. I hadn't any problem with it and it has some important advantages over DS5.2. But we won't have a huge directory so I can't tell you anything more about it.
    Regards
    Jochem Ippers
    Here are the ldifs:
    61DUAConfigProfile.ldif:
    dn: cn=schema
    attributeTypes: ( 1.3.6.1.4.1.11.1.3.1.1.0 NAME 'defaultServerList' DESC 'Default LDAP server host address used by a DUA' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'user defined' )
    attributeTypes: ( 1.3.6.1.4.1.11.1.3.1.1.1 NAME 'defaultSearchBase' DESC 'Default LDAP base DN used by a DUA' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'user defined' )
    attributeTypes: ( 1.3.6.1.4.1.11.1.3.1.1.2 NAME 'preferredServerList' DESC 'Preferred LDAP server host addresses to be used by a DUA' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'user defined' )
    attributeTypes: ( 1.3.6.1.4.1.11.1.3.1.1.3 NAME 'searchTimeLimit' DESC 'Maximum time in seconds a DUA should allow for a search to complete' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'user defined' )
    attributeTypes: ( 1.3.6.1.4.1.11.1.3.1.1.4 NAME 'bindTimeLimit' DESC 'Maximum time in seconds a DUA should allow for the bind operation to complete' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'user defined' )
    attributeTypes: ( 1.3.6.1.4.1.11.1.3.1.1.5 NAME 'followReferrals' DESC 'Tells DUA if it should follow referrals returned by a DSA search result' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' )
    attributeTypes: ( 1.3.6.1.4.1.11.1.3.1.1.6 NAME 'authenticationMethod' DESC 'A keystring which identifies the type of authentication method used to contact the DSA' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'user defined' )
    attributeTypes: ( 1.3.6.1.4.1.11.1.3.1.1.7 NAME 'profileTTL' DESC 'Time to live, in seconds, before a client DUA should re-read this configuration profile' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'user defined' )
    attributeTypes: ( 1.3.6.1.4.1.11.1.3.1.1.14 NAME 'serviceSearchDescriptor' DESC 'LDAP search descriptor list used by a DUA' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'user defined' )
    attributeTypes: ( 1.3.6.1.4.1.11.1.3.1.1.9 NAME 'attributeMap' DESC 'Attribute mappings used by a DUA' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'user defined' )
    attributeTypes: ( 1.3.6.1.4.1.11.1.3.1.1.10 NAME 'credentialLevel' DESC 'Identifies type of credentials a DUA should use when binding to the LDAP server' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' )
    attributeTypes: ( 1.3.6.1.4.1.11.1.3.1.1.11 NAME 'objectclassMap' DESC 'Objectclass mappings used by a DUA' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'user defined' )
    attributeTypes: ( 1.3.6.1.4.1.11.1.3.1.1.12 NAME 'defaultSearchScope' DESC 'Default search scope used by a DUA' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' )
    attributeTypes: ( 1.3.6.1.4.1.11.1.3.1.1.13 NAME 'serviceCredentialLevel' DESC 'Identifies type of credentials a DUA should use when binding to the LDAP server for a specific service' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'user defined' )
    attributeTypes: ( 1.3.6.1.4.1.11.1.3.1.1.15 NAME 'serviceAuthenticationMethod' DESC 'Authentication method used by a service of the DUA' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'user defined' )
    objectClasses: ( 1.3.6.1.4.1.11.1.3.1.2.4 NAME 'DUAConfigProfile' SUP top STRUCTURAL DESC 'Abstraction of a base configuration for a DUA' MUST ( cn ) MAY ( defaultServerList $ preferredServerList $ defaultSearchBase $ defaultSearchScope $ searchTimeLimit $ bindTimeLimit $ credentialLevel $ authenticationMethod $ followReferrals $ serviceSearchDescriptor $ serviceCredentialLevel $ serviceAuthenticationMethod $ objectclassMap $ attributeMap $ profileTTL ) X-ORIGIN 'user defined' )
    62nisDomain.ldif:
    dn: cn=schema
    attributeTypes: ( 1.3.6.1.1.1.1.30 NAME 'nisDomain' DESC 'NIS domain' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'user defined' )
    objectClasses: ( 1.3.6.1.1.1.2.15 NAME 'nisDomainObject' SUP top STRUCTURAL MUST nisDomain X-ORIGIN 'user defined' )

  • Try to use one comupter as both server and client

    Hello, everyone, I am just trying to use my own computer as both server and client to test some codes about networking. For example, use the sample code in java tutorial which is used to test Echo server(code is listed below). Is there anything I have to do to set my computer, such as set my hostname or something like that?
    I am a pure newbie. And the purpose of this question is to test some code including socket on one PC without connect to internet.
    I have tried to change the name "taranis" in the following code to the computer name of my own PC, but it doesn't work, and said: Couldn't get I/O for the connection to: (my computer name).
    import java.io.*;
    import java.net.*;
    public class EchoClient {
    public static void main(String[] args) throws IOException {
    Socket echoSocket = null;
    PrintWriter out = null;
    BufferedReader in = null;
    try {
    echoSocket = new Socket("taranis", 7);
    out = new PrintWriter(echoSocket.getOutputStream(), true);
    in = new BufferedReader(new InputStreamReader(
    echoSocket.getInputStream()));
    } catch (UnknownHostException e) {
    System.err.println("Don't know about host: taranis.");
    System.exit(1);
    } catch (IOException e) {
    System.err.println("Couldn't get I/O for "
    + "the connection to: taranis.");
    System.exit(1);
         BufferedReader stdIn = new BufferedReader(
    new InputStreamReader(System.in));
         String userInput;
         while ((userInput = stdIn.readLine()) != null) {
         out.println(userInput);
         System.out.println("echo: " + in.readLine());
         out.close();
         in.close();
         stdIn.close();
         echoSocket.close();

    Did you write the EchoServer and start it on your
    machine, listening on port 7?
    You can have the client and server running on the same
    machine or different machines, but they have to be
    separate pieces of software.
    Write a separate EchoServer class that starts up and
    listens on that port. Then start the EchoClient and
    make the connection.
    %yeah, I didn't wrote the EchoServer class. But I thought it is automaticly included and therefore has run once I start my computer.
    If I write a EchoServer class, then how should I set the host name of the EchoClient, just simply change "taranis" to my computer name (change "echoSocket = new Socket("taranis", 7);" to echoSocket = new Socket("(my comptuer name)", 7);"?

  • How can i transfer more than one file from server to client

    Hi,
    our requirement is transfer more than one files from server to client using the
    webutil_file_transfer.as_to_client_with_progress.One file transfer is already working in our system.If anybody know the solution please inform
    regards
    mat

    just an idea ...
    for this purpose let us put aside security concerns and other potential problems....
    -- Get the content of a server directory with Filter and create zip file
    1) create a class that implements java.io.FilenameFilter ...
    2) define accept() method ...
    3) call File.list() with the filter as a parameter. The returned array of strings will have all the names that passed through the accept() filter
    4) use java.util.Zip to create ZIP file on the server side
    -- I think it is better to create this functionality as a separate Java class, put it in required folder and after it
    -- use Forms->Program->"Import Java class" to create pl/sql wrappers, than to create wrappers for all classes and code in pl/sql
    5) use webutil to transfer file on the client
    6) use Java on client side to unzip transferred file
    if you think this is not too complicated, you should try ...
    Regards,
    Vladimir

  • Sending file from server to client

    I am creating a server that stores application updates. When the client connects the server send the update. The server is sending the file but the file is not complete, i.e, if the file is 317kb,its send 117kb. Below is the code i am using
    import java.io.BufferedInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class TestFileServer {
      public final static int SOCKET_PORT = 13267;
      public final static String FILE_TO_SEND = "/home/test/1234.exe"; //Does the extension matter?
      public static void main (String [] args ) throws IOException {
      FileInputStream fis = null;
      BufferedInputStream bis = null;
      OutputStream os = null;
      ServerSocket servsock = null;
      Socket sock = null;
      try {
      servsock = new ServerSocket(SOCKET_PORT);
      while (true) {
      System.out.println("Waiting...");
      try {
      sock = servsock.accept();
      System.out.println("Accepted connection : " + sock);
      // send file
      File myFile = new File (FILE_TO_SEND);
      byte [] mybytearray = new byte [(int)myFile.length()];
      fis = new FileInputStream(myFile);
      bis = new BufferedInputStream(fis);
      bis.read(mybytearray,0,mybytearray.length);
      os = sock.getOutputStream();
      System.out.println("Sending " + FILE_TO_SEND + "(" + mybytearray.length + " bytes)");
      os.write(mybytearray,0,mybytearray.length);
      os.flush();
      System.out.println("Done.");
      finally {
      if (bis != null) bis.close();
      if (os != null) os.close();
      if (sock!=null) sock.close();
      finally {
      if (servsock != null) servsock.close();
    What could the problem be?

    What could the problem be?
    The FIRST problem is that your code has NO exception handler and is just HIDING any exceptions that might be occuring.
    Why are you doing that?
    Code should either HANDLE an exception or let it bubble up to the caller.
    Add exception handling to the code and rerun it to see if any exceptions are occuring that could be affecting the outcome.
    The SECOND problem is that you are NOT showing the client side that is being used and any code that might be causing/handling/hiding exceptions on the client side.
    Post a simple test case that includes both server and client that demonstrates the problem you have.

  • File Download from server to client

    Please review the following code. I am attempting to download a file , whether PDF, DOC, TXT, etc.., from the server to client(in this case a DOC file). The f.exist() method returns true so the file exists but the f.length() returns 1. The file is considerably larger than 1 byte. The download occurs but the file contains 1 byte of code.
    Also, please review all the code and suggest any code changes needed to complete the download. I am new to Java programming so be kind.
    File f = new File(filePath + fileName);
    System.out.println("file " + f);
    System.out.println(f.exists());
    System.out.println("file length " + f.length());
    FileInputStream fis = new FileInputStream(f);
    BufferedInputStream bis = new BufferedInputStream(fis);
    response.setContentLength(fis.available());
    System.out.println("bytes " + fis.available());
    response.setContentType("application/msword");
    response.setHeader("Content-disposition","attachment; filename=" + fileName );
    BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream());
    byte[] buff = new byte[1024];
    int bytesRead;
    // Simple read/write loop.
    while(-1 != (bytesRead = bis.read(buff, 0, buff.length)))
    bos.write(buff, 0, bytesRead);
    bos.flush();
    bos.close();
    bis.close();
    response.flushBuffer();
    fis.close();
    } catch(Exception e){
    System.out.print("\n svtFileDownload.processRequestFileDownload Exception=" + e);

    the following is a nippet from a servlet I wrote that does what you want and I've had no problems with it, even with large file 200+ megs.
                String filename = bundle.getFileLocation();
                response.setContentType("application/stream");
                response.setHeader("Content-Disposition","attachment; filename="+filename+";");
                ServletOutputStream out = response.getOutputStream();
                BufferedInputStream fif= new BufferedInputStream(new FileInputStream(FILE_LOCATION+filename));
                int data;
                while((data = fif.read())!=-1)
                    out.write(data);
                fif.close();
                out.close();

Maybe you are looking for

  • Which configuration is better: higher GHz and lower RAM or lower GHz and higher RAM?

    I want to buy a new iMac. If all other factors are the same, including price, which configuration is better? 21.5" iMac (late 2012) $1699 3.1GHz Intel Core i7 Quad-Core 8GB of 1600Hz DDR3 RAM --vs-- 21.5" iMac (late 2012) $1699 2.9GHz Intel Core i5 Q

  • Error in alertlog

    Dear All, Today morning suddenly one of our database instance gone down. So after restart the database when I looked for the alert log file I found the following informations - Memory Notification: Library Cache Object loaded into SGA Heap size 2651K

  • Transferring itunes to a new computer

    i am transferring itunes from my windows xp to my new windows 7. how do i do it? thank you all very much for your time

  • Region Refresh

    Dear All, Use Case: I have an input text and a region below it. In the input text, you could supply employee Id and the region should display Employee Information. On click of a button, I am setting a pageflowscope variable. <af:inputText label="Empl

  • Some entires misses when i view in Maintenance view

    Hi all,          I created a maintenace view for the table HRUS_D2. There are totally 12 entires in the table. Then a table maintenace generator is done for the table. When i go to SM30 and display the view created. I could only see 10 entries. But w