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.

Similar Messages

  • 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.

  • Bluetooth communication  between J2SE server and J2ME client

    Hi everyone!
    I'm new here in this forum...
    I try to make a small project to my studies,
    My project will include J2SE server and J2ME client.
    I'm stuck in the step of finding the server with the wireless toolkit emulator.
    I found this issue in old subject: here
    I try the solution in reply 6 but I don't understand exactly who to define kvem.home, and I got this error:
    " You must define the system property "kvem.home" "
    maybe someone can help me and explain how to do that?
    thanks!

    Hello,
    I want to find out how this can be done, too. I tried with
    System.setProperty("kvem.home", "C:\\WTK2.5.2");but I get an error:
    java.lang.UnsatisfiedLinkError: com.sun.kvem.jsr082.impl.bluetooth.BluetoothController.setSystemProperty(Ljava/lang/String;Ljava/lang/String;)I included these files in the build path:
    c:\WTK2.5.2\wtklib\gcf-op.jar
    c:\WTK2.5.2\wtklib\kenv.zip
    c:\WTK2.5.2\wtklib\kvem.jar
    and I import com.sun.kvem.bluetooth.*;
    I'd appreciate any help.

  • Stun server and stun client

    I came across a concept stun server and stun client....is it possible to use these things in video conferencing in internet.pLease help.....for implemenation and materials,code also

    Hi this is Ramesh iam developing an desktop video conferencing application.
    when i use RTP it is working good in Lan but not in internet.
    so that now planed to use JStun and i have source also while running iam getting this exception
    D:\project\jstun\src>
    java de.javawi.jstun.test.demo.StunServer 42050 121.246.235.202
    42058 121.246.235.202
    java.net.BindException: Cannot assign requested address: Cannot bind
    at java.net.PlainDatagramSocketImpl.bind0(Native Method)
    at java.net.PlainDatagramSocketImpl.bind(Unknown Source)
    at java.net.DatagramSocket.bind(Unknown Source)
    at java.net.DatagramSocket.<init>(Unknown Source)
    at java.net.DatagramSocket.<init>(Unknown Source)
    at de.javawi.jstun.test.demo.StunServer.<init>(StunServer.java:44)
    at de.javawi.jstun.test.demo.StunServer.main(StunServer.java:241)
    121.246.235.202 is my server ip address.which ip i need to use and which port i need to use.
    please give me a brief idea how i can run this.
    if u have any code which is running on internet for video transmission please send me.
    i hope u will help me.
    my mail id :[email protected]

  • Machine server and machine client

    Hello,
    i need to create a communication between two machines solaris 2 installed in VM workstation; to begin with NFS and do these :
    Machine A : share -F nfs /opt
    and in Machine B : mount -F nfs machineA:/opt /mnt
    also
    share -F nfs -o rw=machineB /opt
    and in B
    mount -F nfs machineA:/opt /mnt
    MY need its just about networking between two machines installed in my VM and create a server and a client machine!
    @IP machine A :192.168.1.2
    @IP machine B :192.168.1.3
    may i create an unique domain?
    pleaz show me step by step, im still a beginner with solaris 10 administration part 2.
    Thank you,
    Herbich

    According to certification matrix (metalink) 32bit clients (9.2 and higher) are supported on 64bit servers. Of course in their own ORACLE_HOME.
    Werner

  • Strange problem with AIX server and windows clients

    I am having a real bizzare problem with WLS 7.0.1 running on AIX 5.1 and
    clients on windows. We have J2SE Swing application as a client.
    If the client is w2k or XP, the first client gets good response. If I start
    another client the second client is horribly slow (2 sec vs 16 sec). Even if
    I kill the first client the second client continues to be slow. If I have 2
    clients open together, the first one continues giving 2 sec response while
    the second one continues with 16 sec. For that matter if I start another
    client after shutting down first one I get slow (16 sec) response.
    If the client is NT client I always get good and consistent response from
    the server. Irrespective of how many client I have on the NT machine, I keep
    getting good response. NT and W2K laptops are seating right next to each
    other on the same n/w and infact the NT is a much slower and lessor memory
    machine than W2K.
    We did similar tests keeping server on Solaris or NT server or W2K server,
    and the clients "behave" normally i.e I get consistent repsponse time (it
    may be slow or fast, but it is consistent and is consistent b/w NT and W2K).
    We even tried putting my laptop on the same network as the AIX server, but
    it did not help. Unfortunately some of our clients will be using AIX and
    W2K.
    HELP!!!!

    "Cameron Purdy" <[email protected]> wrote in message
    news:[email protected]..
    Sounds like a reverse DNS lookup or similar network timeout.Thanks for the suggestion, but then why would the first client on w2k or XP
    get a better performance and the subsequent clients get worse performance?
    >
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com/coherence.jsp
    Tangosol Coherence: Clustered Replicated Cache for Weblogic
    "vinay moharil" <[email protected]> wrote in message
    news:[email protected]..
    I am having a real bizzare problem with WLS 7.0.1 running on AIX 5.1 and
    clients on windows. We have J2SE Swing application as a client.
    If the client is w2k or XP, the first client gets good response. If Istart
    another client the second client is horribly slow (2 sec vs 16 sec).
    Even
    if
    I kill the first client the second client continues to be slow. If I
    have
    2
    clients open together, the first one continues giving 2 sec response
    while
    the second one continues with 16 sec. For that matter if I start another
    client after shutting down first one I get slow (16 sec) response.
    If the client is NT client I always get good and consistent responsefrom
    the server. Irrespective of how many client I have on the NT machine, Ikeep
    getting good response. NT and W2K laptops are seating right next to each
    other on the same n/w and infact the NT is a much slower and lessor
    memory
    machine than W2K.
    We did similar tests keeping server on Solaris or NT server or W2Kserver,
    and the clients "behave" normally i.e I get consistent repsponse time(it
    may be slow or fast, but it is consistent and is consistent b/w NT andW2K).
    We even tried putting my laptop on the same network as the AIX server,
    but
    it did not help. Unfortunately some of our clients will be using AIX and
    W2K.
    HELP!!!!

  • Bluetooth simulation between J2SE server and J2ME client

    hi there,
    I have a working bluetooth client/server application (using BlueCove), with the server on a PC (the PC has bluetooth hardware) and the client on a mobile telephone.
    I wish to move the application to a bluetooth simulated environment, however.
    To simulate bluetooth between 2 mobiles, I could open 2 instances of the WTK simulator and the mobiles will find each other -- but this doesn't meet my needs. I wish to simulate the bluetooth environment between a J2SE server and a J2ME client.
    Can I do this using the wireless toolkit? Does anyone have other ideas?
    thanks,
    Manoj

    OK - I have the solution.
    My PC (server) code used BlueCove to talk to the bluetooth stack. The trick is to use Sun's own KVM packages. This creates a virtual bluetooth device on your machine, shared by the WTK emulator.
    Here's the server code:
    package com.encube;
    import java.awt.BorderLayout;
    import java.io.InputStream;
    import javax.microedition.io.Connector;
    import javax.microedition.io.StreamConnection;
    import javax.microedition.io.StreamConnectionNotifier;
    import javax.swing.JFrame;
    import javax.swing.JList;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import com.sun.kvem.bluetooth.BluetoothStateException;
    import com.sun.kvem.bluetooth.DiscoveryAgent;
    import com.sun.kvem.bluetooth.LocalDevice;
    public class Server {
         public static final String UUID_STRING = "A781FDBA229B486A8C21CEBD00000000";
         public static final String SERVICE_NAME = "BTCHATSVR";
         private StreamConnectionNotifier server;
         JFrame jframe;
         JTextArea textArea;
         public static void main(String[] args) {
              Server svr = new Server();
              svr.doWork();
         public void doWork() {
              this.jframe = new JFrame("BT Server");
              this.jframe.setLayout(new BorderLayout());
              this.textArea = new JTextArea(6, 20);
              JScrollPane jsp = new JScrollPane(this.textArea);
              this.jframe.add(jsp, BorderLayout.CENTER);
              this.jframe.pack();
              this.jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              this.jframe.setVisible(true);
              startServer();
         public void logMessage(String message) {
              this.textArea.setText(this.textArea.getText() + message + "\n");
              this.textArea.setCaretPosition(this.textArea.getText().length());
         public void startServer() {
              LocalDevice local;
              try {
                   local = LocalDevice.getLocalDevice();
                   local.setDiscoverable(DiscoveryAgent.GIAC);
                   this.logMessage("max of "
                             + LocalDevice
                                       .getProperty("bluetooth.connected.devices.max")
                             + " connection(s) supported");
                   String url = "btspp://localhost:" + UUID_STRING + ";name="
                             + SERVICE_NAME;
                   server = (StreamConnectionNotifier) Connector.open(url);
                   this.logMessage("waiting for connection...");
                   StreamConnection conn = server.acceptAndOpen();
                   this.logMessage("connection opened");
                   InputStream is = conn.openInputStream();
                   byte buffer[] = new byte[1000];
                   while (true) {
                        int numChars = is.read(buffer);
                        String s = new String(buffer);
                        logMessage("received from mobile phone: " + s.substring(0, numChars));
              } catch (Exception e) {
                   this.logMessage(e.getMessage());
    }You need to include the location of WTK as the kvem.home define. If its installed in c:\wtk22 (the default), start the server with the parameter -Dkvem.home="c:\wtk22". You also need to include these 3 libraries:
    c:\wtk22\wtklib\gcf-op.jar
    c:\wtk22\wtklib\kenv.zip
    c:\wtk22\wtklib\kvem.jar
    That's it for the server. My code of the sample client (the mobile phone, running in the WTK emulator) is messy (sorry about that -- still cleaning it up)!
    import java.io.IOException;
    import java.io.OutputStream;
    import java.util.Enumeration;
    import java.util.Timer;
    import java.util.TimerTask;
    import java.util.Vector;
    import javax.bluetooth.BluetoothStateException;
    import javax.bluetooth.DeviceClass;
    import javax.bluetooth.DiscoveryAgent;
    import javax.bluetooth.DiscoveryListener;
    import javax.bluetooth.LocalDevice;
    import javax.bluetooth.RemoteDevice;
    import javax.bluetooth.ServiceRecord;
    import javax.bluetooth.UUID;
    import javax.microedition.io.Connector;
    import javax.microedition.io.StreamConnection;
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Form;
    import javax.microedition.lcdui.StringItem;
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.midlet.MIDletStateChangeException;
    public class MainMIDlet extends MIDlet {
         protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
              // TODO Auto-generated method stub
         protected void pauseApp() {
              // TODO Auto-generated method stub
         protected void startApp() throws MIDletStateChangeException {
              MainForm mainForm = new MainForm();
              Display.getDisplay(this).setCurrent(mainForm);
              mainForm.initializeDisplay();
    class MainForm extends Form {
         public static final String UUID_STRING = "A781FDBA229B486A8C21CEBD00000000";
         private StringItem log;
         private DiscoveryAgent agent;
         Object lock = new Object();
         static EndPoint currentEndPoint;
         static Vector serviceRecords = new Vector();
         public MainForm() {
              super("BT Client");
         public void initializeDisplay() {
              this.log = new StringItem("", "");
              this.append(this.log);
              try {
                   LocalDevice local = LocalDevice.getLocalDevice();
                   agent = local.getDiscoveryAgent();
                   agent.startInquiry(DiscoveryAgent.GIAC, new Listener(this, agent));
              } catch (BluetoothStateException e) {
                   this.logMessage(e.getMessage());
         public void logMessage(String message) {
              this.log.setText(this.log.getText() + message + "\n");
         public void processServiceRecord(ServiceRecord sr) {
              try {
                   String url = sr.getConnectionURL(
                             ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);
                   logMessage("opening URL " + url);
                   StreamConnection conn = (StreamConnection) Connector.open(url);
                   OutputStream os = conn.openOutputStream();
                   String smessage = "test message from phone emulator";
                   os.write(smessage.getBytes());
              } catch (IOException e) {
                   logMessage("error while processing service record: "
                             + e.getMessage());
         class Listener implements DiscoveryListener {
              private MainForm mainForm;
              private Vector pendingEndPoints;
              private DiscoveryAgent agent;
              public Listener(MainForm mainForm, DiscoveryAgent agent) {
                   this.mainForm = mainForm;
                   this.agent = agent;
                   this.pendingEndPoints = new Vector();
              public void deviceDiscovered(RemoteDevice dev, DeviceClass deviceClass) {
                   this.mainForm.logMessage("found device");
                   this.pendingEndPoints.addElement(new EndPoint(dev));
              public void inquiryCompleted(int arg0) {
                   this.mainForm.logMessage("done searching for devices");
                   for (Enumeration enm = this.pendingEndPoints.elements(); enm
                             .hasMoreElements();) {
                        EndPoint ep = (EndPoint) enm.nextElement();
                        ep.calculateRemoteName();
                        this.mainForm.logMessage("device name: " + ep.getRemoteName());
                   new Timer().schedule(new DoServiceDiscovery(), 100);
              public void servicesDiscovered(int transID, ServiceRecord[] arg1) {
                   mainForm.logMessage("found " + arg1.length
                             + " service(s) on device "
                             + currentEndPoint.getRemoteName());
                   for (int i = 0; i < arg1.length; i++) {
                        serviceRecords.addElement(arg1);
              public void serviceSearchCompleted(int arg0, int arg1) {
                   synchronized (lock) {
                        * unlock to proceed to service search on next device see
                        * DoServiceDiscovery.run()
                        lock.notifyAll();
                   mainForm.logMessage("done searching for services on "
                             + currentEndPoint.getRemoteName());
              * Inner class. Called a short time after the last device is found.
              class DoServiceDiscovery extends TimerTask {
                   public void run() {
                        try {
                             UUID uuids[] = new UUID[2];
                             * ok, we are interesting in btspp services only and only
                             * known ones -- check for our UUID
                             uuids[0] = new UUID(0x1101);
                             uuids[1] = new UUID(MainForm.UUID_STRING, false);
                             for (Enumeration enm = pendingEndPoints.elements(); enm
                                       .hasMoreElements();) {
                                  EndPoint ep = (EndPoint) enm.nextElement();
                                  mainForm.logMessage("searching for services on "
                                            + ep.getRemoteName());
                                  currentEndPoint = ep;
                                  ep.transId = agent.searchServices(null, uuids,
                                            ep.remoteDev, new Listener(mainForm, agent));
                                  synchronized (lock) {
                                       try {
                                            lock.wait();
                                       } catch (InterruptedException e) {
                                            // do nothing
                                            mainForm.logMessage("exception while waiting: "
                                                      + e.getMessage());
                             mainForm.logMessage("discovered all services; found "
                                       + serviceRecords.size() + " record(s)");
                             * assume we have just 1 service record
                             if (serviceRecords.size() > 0) {
                                  processServiceRecord((ServiceRecord) serviceRecords
                                            .elementAt(0));
                        } catch (Exception e) {
                             mainForm.logMessage("error during service discovery: "
                                       + e.getMessage());
    class MiscUtils {
         * Get the friendly name for a remote device. On the Nokia 6600, we're able
         * to get the friendlyname while doing device discovery, but on the Nokia
         * 6230i, an exception is thrown. On the 6230i, we get the friendly name
         * only after all devices have been discovered -- when the callback
         * inquiryCompleted is called.
         * @param dev
         * the device to examine
         * @return a friendly name for the device, otherwise the IP address as a
         * hex-string
         public static String getDeviceName(RemoteDevice dev) {
              String devName;
              try {
                   devName = dev.getFriendlyName(false);
              } catch (IOException e) {
                   devName = dev.getBluetoothAddress();
              return devName;
         public static EndPoint findEndPointByTransId(Vector endpoints, int id) {
              for (int i = 0; i < endpoints.size(); i++) {
                   EndPoint endpt = (EndPoint) endpoints.elementAt(i);
                   if (endpt.getTransId() == id) {
                        return endpt;
              return null; // not found, return null
    class EndPoint {
         // remote device object
         RemoteDevice remoteDev;
         // remote device class
         DeviceClass remoteClass;
         // remote service URL
         String remoteUrl;
         // service hosted on this device -- populated after searching for devices
         ServiceRecord serviceRecord;
         // bluetooth discovery transId, obtainsed from searchServices
         int transId = -1; // -1 must be used for default. cannot use 0
         // local user nick name
         String localName;
         // remote user nick name
         String remoteName;
         // vector of ChatPacket pending to be sent to remote service.
         // when message is sent, it is removed from the vector.
         Vector msgs = new Vector();
         public EndPoint(RemoteDevice rdev) {
              remoteDev = rdev;
         * This functionality isn't called in the constructor because we cannot
         * retrieve the friendly name while searching for devices on all phones. On
         * some phones we have to wait until after devices have been discovered.
         public void calculateRemoteName() {
              this.remoteName = MiscUtils.getDeviceName(this.remoteDev);
         public RemoteDevice getRemoteDev() {
              return remoteDev;
         public String getRemoteName() {
              return remoteName;
         public ServiceRecord getServiceRecord() {
              return serviceRecord;
         public void setServiceRecord(ServiceRecord serviceRecord) {
              this.serviceRecord = serviceRecord;
         public int getTransId() {
              return transId;
    ...and that's it. Start the server, then the client (all on the same machine) and you've simulated bluetooth between the 2.
    To get the server working with a real mobile, you'll need to use the BlueCove library instead of the 3 WTK jars (and can remove the kvem.home directive as well). The rest of the code should remain the same (haven't quite tested that yet!).
    cheers
    Manoj
    null

  • RMI Server and RMI Client Problem

    First, Hi!
    I have create my RMI Server and a RMI Servlet client.
    I can run the server and servlet first time and it works fine.
    Then, I stop rmiregistry and server.
    Then, I start rmiregistry and server for a second time but my RMI Servlet client gets a
    java.rmi.ConnectException: Connection refused to host: xxx.xxx.xxx.xxx; nested exception is: java.net.ConnectException: Connection refused
    If I copy the class again where the servlets resides, it works again. But I have to keep doing that. I have to keep copying the class file to the servlet directory every 2nd time I try to run it for it to work.
    Anyone know what am I doing wrong?

    First, Hi!
    I have create my RMI Server and a RMI Servlet client.
    I can run the server and servlet first time and it
    works fine.
    Then, I stop rmiregistry and server.
    Then, I start rmiregistry and server for a second time
    but my RMI Servlet client gets a
    java.rmi.ConnectException: Connection refused to host:
    xxx.xxx.xxx.xxx; nested exception is:
    java.net.ConnectException: Connection refused
    If I copy the class again where the servlets resides,which class file ? u mean RMIServer's class files ??
    I have faced the same problem too. In my case if i just restart my Tomcat webserver the error goes and the servlet is very well able to connect back to the RMI Server
    it works again. But I have to keep doing that. I have
    to keep copying the class file to the servlet
    directory every 2nd time I try to run it for it to
    work.
    Anyone know what am I doing wrong?

  • Web application in linux server and windows clients

    Hi,java expert and experienced developer, i need your advise and experience sharing.
    I have project, which the server is RedHat Linux and clients be Windows. The application is a web application. The database used is MySQL. My question are:
    1) Should i use JDK from blackdown or sun?
    2) If i install blackdown JRE in Server(Linux), then is it ok that the clients(Windows) installs the Sun JRE?
    3) Is there any issues Jakarta Struts in Linux?
    Thanks in advance.

    If your application is different, and does a lot of updating, , you
    may want to look elsewhere.Yes, that why i say performance issue....
    Ok, MySQL however will enable stored procedure in version 5.0, but when the release will be available?
    PostgreSQL may be another option look to. Any opinion in term of:
    -performance
    -reliability
    -usage experience
    thanks in advance

  • Comunication question for socket server and socket client

    I created a simple socket server and a socket client
    The server receive request from server and send same request back to the client.
    Please see example code as below:
    package socket;
    import java.net.*;
    import java.io.*;
    public class SimpleServer {
    public SimpleServer(int listen_port) {
    this.listen_port = listen_port;
    public static void main(String[] args) {
    SimpleServer server = new SimpleServer(4444);
    server.acceptConnections();
    public void acceptConnections() {
    try {
    ServerSocket server = new ServerSocket(listen_port);
    Socket incomingConnection = null;
    while (true) {
    incomingConnection = server.accept();
    handleConnection(incomingConnection);
    } catch (BindException e) {
    System.out.println("Unable to bind to port " + listen_port);
    } catch (IOException e) {
    System.out.println("Unable to instantiate a ServerSocket on port: " + listen_port);
    public void handleConnection(Socket incomingConnection) {
    try {
    InputStream inputFromSocket = incomingConnection.getInputStream();
    BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputFromSocket));
    PrintWriter streamWriter = new PrintWriter(incomingConnection.getOutputStream());
    StringBuffer sb = new StringBuffer();
    String line = null;
    int i = 0;
    while((line=streamReader.readLine())!=null){
    streamWriter.println(line);
    break;
    streamWriter.close();
    streamReader.close();
    incomingConnection.close();
    } catch (Exception e) {
    protected int listen_port;
    //socket client
    package socket;
    import java.io.*;
    import java.net.*;
    import java.util.Iterator;
    import java.util.List;
    import java.math.*;
    public class Simple {
    public Simple(String host_ip, int host_port) {
    this.host_ip = host_ip;
    this.host_port = host_port;
    public static void main(String[] args) {
    Simple simple = new Simple("192.168.254.134", 4444);
    simple.setUpConnection();
    try {
    String result = simple.getResponse("This is first request");
    String result2 = simple.getResponse("This is second request");
    simple.tearDownConnection();
    catch (Exception e) {
    System.out.println("error");
    e.printStackTrace();
    public void setUpConnection() {
    try {
    // Create new socket object
    Socket client = new Socket(host_ip, host_port);
    socketReader = new BufferedReader(new InputStreamReader(client.
    getInputStream()));
    socketWriter = new PrintWriter(client.getOutputStream());
    } catch (UnknownHostException e) {
    System.out.println(
    "Error setting up socket connection: unknown host at " +
    host_ip + ":" + host_port);
    catch (IOException e) {
    System.out.println("Error setting up socket connection: " + e);
    public String getResponse(String request) {
    StringBuffer fileLines = new StringBuffer();
    try {
    socketWriter.println(request);
    socketWriter.flush();
    String line = null;
    int i = 0;
    int chars = 0;
    int sizeOfBuffer = 100;
    char[] cbuf = new char[sizeOfBuffer];
    while ( (chars = socketReader.read(cbuf)) >= 0) {
    fileLines.append(cbuf, 0, chars);
    } catch (Exception e) {
    e.printStackTrace();
    return fileLines.toString();
    public void tearDownConnection() {
    try {
    socketWriter.close();
    socketReader.close();
    } catch (IOException e) {
    System.out.println("Error tearing down socket connection: " + e);
    protected BufferedReader socketReader;
    protected PrintWriter socketWriter;
    protected String host_ip;
    protected int host_port;
    I send two request at the same time.
    Please see code in main method of Simple class
    String result = simple.getResponse("first");
    String result2 = simple.getResponse("second");
    What I think is the socket server will send the same request back to the client.
    So value of result and result2 should be 'first' and 'second'
    But it always return empty String for result2.
    What's the problem?
    Thanks for your help

    Your code has a couple of problems.
    1) the server doesn't flush its socket, so nothing will actually be sent until the socket is closed.
    2) the client getResponse() reads until end of file, so an attempt to use it a second time will fail
    3) in a real application the server should use threads. See the echo server I posted in http://forum.java.sun.com/thread.jsp?forum=11&thread=526980 reply 3.
    Also, please use the [code]  tags when posting source. The lack of these is probaly why you haven't had any repiles until now.

  • How to setup iCal on a Lion server and its client machines?

    I recently bought a new mini server (running Lion) in order to share our iCal calenders (like in the Apple presentations). I thought this would be an easy process but apparently it isn't. So what was I already able to achieve:
    1) Set up 5 different clients (on the Lion server), with corresponding e-mailadresses and passwords.
    2) Activated iCal on the server preference window (ical: on)
    3) Tried to add the user a account on one of the five client machines => HERE it goes wrong.
    My main issue is that I'm not able to add a user account on a client machine and have it connected to the server.
    It would be really nice if someone could assist me with it.
    Warm Regards

    I posted additional information  online using the newly created Launchpad login Service account.
    I hope that explains my situation, if not I will add more detail here.
    There is no problem, when ither of the two OS are used to enable printing with the HP Deskjet 2050 J510 series printer.
    The problem begins when I try to print from the other OS , when connected to one of the Operating System.
    I have tried without success to print from Windows 7 Ultimate 64-bit OS from an HP Deskjet 2050 J510 series connected to a Ubuntu 12.04 LTS server with Amahi (HDA), installed.
    The same thing occurred when I tried to print from the Ubuntu server and the printer was connected to the Windows 7 Ultimate 64-bit running P.C.

  • 9i server and vista clients

    Hello,
    we have 9i server and were running 9i clients on windows 2000. Now some clients were upgraded to windows vista, so what version of oracle client shall we use to be compatible with vista ? Do we need to upgrade the server as well ?
    Thank you for answers.

    Which 9i version ? 9.1 or 9.2 ? You can use a 10g client to connect to 9.2 database.
    MOS Doc 207303.1 (Client / Server / Interoperability Support Between Different Oracle Versions)
    HTH
    Srini

  • Sharing DSL between Mac Server and PC client

    Hello,
    I'm running a small Mac server network of 3 Mac clients and 1 PC. They are all connected via ethernet to a switch. There is a DSL modem also connected to the switch. The modem software was installed on the Mac server.
    The Mac clients can access the Mac server as well as access the DSL modem to get on-line. The PC is running XP Pro. I can either set up his LAN network connection to see the Mac server or manipulate the settings in that same LAN network connection to see the DSL modem and get on-line. I can't seem to do both.
    On the Macs, I set up separate network configurations with the appropriate tcp/ip settings required for the 2 tasks in question.
    It seems like there should be a way to set up another separate LAN connection on the problem PC, much like I did on the Macs, to allow both server and DSL access.
    1. Does anyone know if this is possible?
    2. Does anyone know of another way to get the pc to see the server and the dsl simultaneously, using the same ethernet connection?
    Thank you in advance for any help.
    Allan
    p.s. The macs are running 10.39 and the server is running 10.1.2.

    Hi Allan!
    I suggest you replace your switch for a router. The purpose of a router is to connect two networks. In your case it would connect your local computer network (Macs, server and PC) to the Internet. Having your DSL on a switch with the rest of your machines means that only one at a time should be able to connect to the Internet.
    Hope this helps! bill
    1 GHz Powerbook G4   Mac OS X (10.4.8)  

  • Document Units between InDesign Server and InDesign Client

    I am working between a Client application using InDesign CC and a Server application using InDesign Server CC.  The problem is that the Clients have their default document width/height settings set to Picas whereas the Server's settings seem to be in Inches.  This is causing problems when Server application is trying to generate a PDF in the units specified by the client.  I need help in figuring out how to get InDesign Server to use Picas instead of Inches.
    Here is a sample of the code used to look at the page width/height values.  I have a module-level boolean called 'mInDesignServer' set to True to test with InDesign Server and False to test with InDesign:
                     If mInDesignServer Then
                        doc = DirectCast(Application.Documents, Global.InDesignServer.Documents).Add
                    Else
                        doc = Application.Documents.Add
                    End If
                    doc.ViewPreferences.RulerOrigin = Global.InDesign.idRulerOrigin.idPageOrigin ' Global.InDesign.idRulerOrigin.idSpreadOrigin
                    doc.ViewPreferences.HorizontalMeasurementUnits = Global.InDesign.idMeasurementUnits.idPicas
                    doc.ViewPreferences.VerticalMeasurementUnits = Global.InDesign.idMeasurementUnits.idPicas
                    doc.ZeroPoint = myZeroPoint
                    ' Look at the document preferences
                    Debug.WriteLine(IIf(mInDesignServer, "Server", "Client") & " " & _
                        "Page Height: " & doc.DocumentPreferences.PageHeight & " " & _
                        "Page Width: " & doc.DocumentPreferences.PageWidth & " " & _
                        "Page Size: " & doc.DocumentPreferences.PageSize)
    Here is the output from the Debug.WriteLine statement when run under both conditions:
         Server Page Height: 11 Page Width: 8.5 Page Size: Letter
         Client Page Height: 66 Page Width: 51 Page Size: Letter
    As stated above, how can I get InDesign Server CC to change its default units to Picas to match that of the Client?
    Thanks,
    Jody

    This worked for me...
    oDocument.ViewPreferences.HorizontalMeasurementUnits = idMeasurementUnits.idMillimeters
    oDocument.ViewPreferences.VerticalMeasurementUnits = idMeasurementUnits.idMillimeters

  • Network bandwidth requirement between MDM server and MDM Clients

    The MDM Sizing document for 5.5 states that  'a network connection between MDM Servers and MDM clients should be at least 100 Mbps'. Is this true? This would preclude MDM being offered as a hosted service. I'm interested in MDM Catalogue for SRM, so the catalogue content managers would need the import and data manager clients.

    One factor I noticed, in our project...
    I would recommend a 4 GB RAM for someone who is working with Import Manager.
    As far as the Network connection goes, I am not sure what the requirements are.
    We have faced several issues when the end user's laptop are less than 2 GB.
    If someone is working with Image Manager, then I would recommend 4GB.
    For bulk imports, I would use Import Server.

Maybe you are looking for

  • Bootcamp Windows 7 (64) Drivers

    After 2 days of struggling to find the right way to install Window 7's drivers properly I'm out of ideas. I've installed Windows 7 now twice with no issue, it just seems I can't get a single driver to work for me. I'll list the specs of my computer a

  • Static Text - Font Size

    I have a requirement for an Add-On form to make the text larger than normal (larger than than all the other forms) as it needs to be read from some distance away. it_STATIC items do not have a FontSize attribute, is there another way of overriding th

  • Can Drag But Not Drop

    Hello. This is my first time posting. I have a problem I cannot solve. I was able to DRAG and DROP my iTunes songs in the order I wanted them. But cannot do so anymore. Something must have changed somewhere. I saw somewhere on another forum to sort b

  • Why do I have a black sreen when I try to watch a youtube video. I have sound but no video and if I click on the black screen firefox crashes.

    why do I have a black sreen when I try to watch a youtube video. I have sound but no video and if I click on the black screen firefox crashes.

  • Nokia PC Suit

    For almost 2 month I'm trying to Install Nokia PC Suit ver. 6.85 on my IBM ThinkPad Laptop, and I'm always recieving the same note which iterupped the Installation: This version of PC-Connectivity Solution canot be used with the currently installed v