Finding the clients connected to a server

Hai Friends,
I am doing a project in grid computing. I have developed a socket program for the client and server side using java and multithreading.
I want to know the number of clirnts connected at a particular period of time and also the IP addresses of the client.
Can anyone please suggest us the code for doing that.

Create an object that describes each client. Something like:
public class Client
    private Socket socket;
    private WhatEver whatEverDataYouNeed;
    ...whatever methods you need...
}When a client connects create one of those objects and store it in a suitable data structure, e.g. LinkedList. When a client disconnects remove from list.
There should be a method in Socket that gives you the IP address, see the javadoc for Socket.

Similar Messages

  • How to find the client number of xMII server i m running

    Hi experts,
    Here i am simply providing the URL in my browser and it shows the login page of xMII server.But i want to find under which client i am currently running this xMII ,how can i find that client number?
    Thanks ,
    S.Ramesh Kumar.

    The term "client" does not neccessary apply with xMII.  A "client" is an organization level in ECC.  If you are looking for the system information open the url
    http://server:port
    and select system information.
    Jamie

  • The client connection is not allowed on the internal edge of the Access Edge Server

    We are trying to setup Lync 2013 Edge Server, we have a setup as described below
    Real IPs for Lync Edge/WebConf/AV
    NAT of real IPs through Firewall Juniper to FE IP
    Topology with NAT (Firewall IP) IP enabled
    Certificates for with SAN for sip.acme.com etc (Both certs are Client Server Auth Templates from Internal MS CA)(Trusted) on Edge
    Route  192.215.0.0 255.255.255.0 gateway (=firewall internal ip address)
    But when external user connects and we are tracing the connection we are getting below error and lync client is 
    not able to connect.
    TL_INFO(TF_CONNECTION) [1]0AD8.0C30::09/07/2014-08:11:13.091.0000000f
    (SIPStack,SIPAdminLog::WriteConnectionEvent:SIPAdminLog.cpp(454))[4150361027] $$begin_recordSeverity: information
    Text: TLS negotiation started
    Local-IP: 192.215.0.xxx:5061 (Edge IP)
    Peer-IP: 192.215.0.xxx:1835 (Firewall IP)
    Connection-ID: 0x1100
    Transport: TLS 
    $$end_record
    TL_ERROR(TF_CONNECTION) [0]0AD8.0638::09/07/2014-08:12:45.279.0000005d (SIPStack,SIPAdminLog::WriteConnectionEvent:SIPAdminLog.cpp(389))[4150360514] $$begin_record
    Severity: error
    Text: The client connection is not allowed on the internal edge of the Access Edge Server
    Peer-IP: 192.xxx.0.xxx:1322 (firewall ip)
    Transport: TLS
    Result-Code: 0xc3e93d6b SIPPROXY_E_CONNECTION_INTERNAL_FROM_CLIENT
    $$end_record

    Hi pshetty,
    Check the following blog to deploy your Edge Server:
    http://jsilverdrake.blogspot.se/2012/04/publishing-lync-with-forefront-tmg-part_25.html
    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make
    sure that you completely understand the risk before retrieving any suggestions from the above link.
    You need to create persistent static routes on the internal interface to all internal networks.
    Regards,
    Lisa Zheng
    Lisa Zheng
    TechNet Community Support

  • Cannot find the Novell Connection Manager for LDAP

    Novell Connection Manger for Java/LDAP
    Cannot find the Novell Connection Manager for LDAP in download
    I am trying to connect through a Java client to the Apache Directory Studio, LDAP server....I have downloaded the classes from the download page...see link below...but I can't see the NovellConnectionManager Class anywhere in this download when I use the open freely application to view the jar details.
    LDAP Classes for Java
    Environment: Windows 7

    Hi MentalSuplex, and a warm welcome to the forums!
    Don't know about Airport cards for it, but other options...
    http://eshop.macsales.com/item/Sonnet%20Technology/N80211PCI/
    Maybe this one, ask them...
    http://eshop.macsales.com/item/Newer%20Technology/MXP802NPCI/
    I use these...
    http://eshop.macsales.com/item/Newer%20Technology/MXP2802NU2C/
    http://eshop.macsales.com/item/Edimax/EW7711UMN/

  • ORA-12518 TNSlistener could not hand off the client connection

    I am using oracle 11g on windows sever 2008. when i am trying to connect application to database it gives the error ORA-12518 TNSlistener could not hand off the client connection. and everytime when i connect it gives the error.there is a need of either restart the database or increase the number of processes. many times i increased the number of processes. now the no. of processes is 500 and maximum utilization is 437 and current utilization is 435. how can i resolve the problem permanently.
    thanks in advance....
    Edited by: k.bhanja on Mar 21, 2012 10:53 PM

    thanks kuljit,
    In sqlnet.ora i am getting the following error..
    Fatal NI connect error 12518, connecting to:
    (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=WIN-2CS4P4UZMJL)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)(SERVER=DEDICATED)(CID=(PROGRAM=C:\app\Administrator\product\11.1.0\db_1\jdk\jre\bin\java.exe)(HOST=WIN-2CS4P4UZMJL)(USER=Administrator))))
    VERSION INFORMATION:
         TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
         Windows NT TCP/IP NT Protocol Adapter for 32-bit Windows: Version 11.1.0.6.0 - Production
    Time: 16-MAR-2012 16:08:45
    Tracing not turned on.
    Tns error struct:
    ns main err code: 12564
    TNS-12564: TNS:connection refused
    ns secondary err code: 0
    nt main err code: 0
    nt secondary err code: 0
    nt OS err code: 0
    and in listener log file....
    21-MAR-2012 00:00:05 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.15.1.26)(PORT=39001)) * establish * orcl * 12518
    TNS-12518: TNS:listener could not hand off client connection
    TNS-12560: TNS:protocol adapter error
    TNS-00530: Protocol adapter error
    32-bit Windows Error: 233: Unknown error
    but if i increase the number of processes or restart the database, the problem does not occur.

  • How to find existing DAC connection to sql server

    How to find existing DAC connection in sql server  

    Hi RoyalM,
    Vishal has answered your initial question. If you have the connection issue. I suggest you elaborate the issue in a new thread.
    You can access DAC using SQLCMD from a command prompt. Or check the existing DAC connection in a command prompt:
    1. Open Command Prompt.
    2. Type: SQLCMD –S <servername\instance> -d master and press Enter.
    1> SELECT name,local_tcp_port FROM sys.dm_exec_connections ec join sys.endpoints e on (ec.endpoint_id=e.endpoint_id) WHERE e.name='Dedicated Admin Connection'
    2> go
    3. If it returns the result, it means there is an existing DAC connection. It also shows the port used by dedicated admin connection.
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Get the Oracle version of the clients connected

    Dear Experts,
    I've got a 9i server. I need to know if the version of the clients connected is 8i or 9i. How can I get this information ?
    Thanks for any input.
    Regards,
    Guillaume

    SQL> select banner from v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    PL/SQL Release 9.2.0.6.0 - Production
    CORE    9.2.0.6.0       Production
    TNS for Solaris: Version 9.2.0.6.0 - Production
    NLSRTL Version 9.2.0.6.0 - Production
    SQL> disconnect
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production

  • How to find the webclient in SAP MDM server

    How to find the webclient in SAP MDM server
    Thanks In Advance
    GuruvaReddy

    Hi Guruva,
    If you are talking about MDM APIs, then you will get them from Service place when you download the complete MDM 5.5 Suite. You need to choose the API which is appropriate to you. MDM comes with 2 different APIs - Java API and COM API as of SP1(The news is.. ABAP API is under development).
    Pre-requisite for building applications using Java APIs is basic Java skills.
    Regards,
    Rajani Kumar K

  • What determines the client connection memory size?

    We are trying to scale up the number of connections on our db - (dedicated not shared) .. but quickly consume the box.
    Its 11gr1 - Linux .. 500G of memory ..
    The "only" parameter we have set is:
    *.memory_target=216522555392  (~200G)
    Processes set to 6000 - but are are only around 1800 at this point.
    We are seeing (via top) client connections with a reserved memory of 25-30g (usually the dbwr type processes) and client connections showing 5-10G in size.
    With clients taking this much memory,  we start to see swapping on the box. In our dev/qa environment the clients are in the MB range .. of course they are not seeing real world traffic so I presume that memory requirements are growing as the app runs.
    Can we set something to reduce the footprint of the client connections?
    Thanks for any tips..
    If we get one db bounce this year .. we want to be right .. cant guess here..
    Daryl

    DarylE. wrote:
    We are trying to scale up the number of connections on our db - (dedicated not shared) .. but quickly consume the box.
    Its 11gr1 - Linux .. 500G of memory ..
    The "only" parameter we have set is:
    *.memory_target=216522555392  (~200G)
    Processes set to 6000 - but are are only around 1800 at this point.
    We are seeing (via top) client connections with a reserved memory of 25-30g (usually the dbwr type processes) and client connections showing 5-10G in size.
    With clients taking this much memory,  we start to see swapping on the box. In our dev/qa environment the clients are in the MB range .. of course they are not seeing real world traffic so I presume that memory requirements are growing as the app runs.
    Can we set something to reduce the footprint of the client connections?
    Thanks for any tips..
    If we get one db bounce this year .. we want to be right .. cant guess here..
    Daryl
    >Can we set something to reduce the footprint of the client connections?
    no
    Since *NIX maps SGA into every client's process, displayed RAM size is distorted.
    If you simply SUM every reported client size, it will greatly exceed total RAM (in most cases)
    The fact that any swap is used is in itself not a negative indicator.
    run vmstat like below
    all is OK when (si + so) is less than (bi + bo)
    [oracle@localhost dbs]$ vmstat 10 6
    procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
    r  b   swpd   free   buff     cache     si   so    bi    bo   in   cs us sy id wa st
    0  0     32  82684  20384 557096    0    0   120    32 1008 1057  3  7 88  1  0
    0  0     32  82560  20408 557124    0    0     0    20 1031 1225  2  4 93  0  0
    0  0     32  82560  20432 557116    0    0     0    16 1002 1183  2  6 92  0  0
    0  0     32  79212  20456 557144    0    0     0    74 1007 1185  4 12 84  0  0
    0  0     32  78592  20480 557148    0    0     0    21  999  998  2  5 92  0  0
    0  0     32  78592  20504 557140    0    0     0    20 1002  929  2  7 91  0  0
    [oracle@localhost dbs]$

  • Need to find the free space on storage server

    Hi,
    I need to find the free space on storage server through Java code, and even find whether web server has access to the storage server.
    So please tell me how do i do that.

    This will be through an API for your "storage
    server". It would be helpful if you at least
    indicated what this "storage server" is: a NFS? an
    FTP site? something else?I forgot to mention that. Its NFS. Please let me know
    clearly, what APIs I need to use and in simple how.How am I supposed to clearly know this?
    Consult the documentation for your NFS system and figure it out. That's what to do.

  • Where can I find the download for Mac OSX Server Mountain Lion ?

    Where can I find the download for Mac OSX Server Mountain Lion ?

    On the App Store. Search for it:

  • Can't find the printer connection on Satellite M40

    Silly question but I can't find the printer connection on my satellite M40? There looks to be a place for it on the left hand side of the notebook - there is a little printer sign, but the actual socket is covered over - should I remove it? and how do I do it? Help!!

    Hello
    As far as I know you can connect printer directly if you use USB port (newer printers). On the left side there are three ports:
    - RGB (Monitor) port
    - One USB port and
    - PC Card slot
    I really do not understand where you have found printer sign there.

  • How do I find the current connections?

    I've noticed that the disk doesn't always spin down after using my media player (OSMC on a Raspberry Pi) to access my My Cloud, and I'd like to debug this. First, I need to see if there's a persistent connection by checking the connection status at the My Cloud command line.  Googling tells me that you use the "smbstatus" command for this -- and there's my first stumbling block. That command is not present because it's in the "samba" package, which I am surprised to find is not installed by default.  # apt-cache policy samba
    samba:
    Installed: (none)
    Candidate: 2:4.1.17+dfsg-2
    Version table:
    2:4.1.17+dfsg-2 0
    500 http://ftp.us.debian.org/debian/ jessie/main armhf Packages I could install the "samba" package with "apt-get install samba". Is that safe to do on the My Cloud? The My Cloud is all about providing samba shares and yet the "samba" package is not installed. I was wondering if it was not installed for a reason. Installing it won't trash the My Cloud's normal services? Or is there a better way to find the current connections -- one that doesn't need the "smbstatus" command?

    Hi and welcome to the WD community.
    I have not tried this, lets see if another user can share some tips and information on this matter.

  • Change the ITS connection to Message Server

    Hi Gurus,
    Our project is using EP7 to access ECC 6 via ITS web access. EP7 -> ITS -> ECC 6
    Currently, we has configured Group access via Message Server on ECC 6. We notice that, the ITS is still connected to Single Application Server on ECC 6. Do anyone know how to change the ITS connection to Message Server instead of Dedicated Application Server?
    Please help.
    Thanks,
    HauChee

    Hello,
    Let's say your ITS port is 8000
    The way to distribute load of integrated ITS requests to the different Dialog instances is to call port 8001 of the message server... That's it...
    So basically the rule is:
    Always call the message server hostname + defined ITS port number + 1
    So in your EP7 system object you define your ITS as:
    http://ECCITSMessageServer.domain.com:8001/...
    Same rule apply in the WebAS section of that EP system object.
    Then, the message server will redirect the request to one of the available dialog instances of integrated ITS on port 8000.
    You will be able to see the redirection happenning by using an HTTP sniffer program like HTTPWatch ($$).
    Regards,
    Marc.

  • How to make the client connect to the server at the command prompt?

    I found this code on IBM's website, it was a training session on servers and clients using java.
    The code compiles fine and the server seems to start up properly when I use java Server 5000. I think whats happening is the server is running and listening for a connection on port 5000.
    When I try to run the client I get the following error.
    Exception in thread "main" java.lang.NoSuchMethodError: main
    I see a start() method but no main. As far as I know, applications should all have main, it seems as if the person who wrote this kinda confused applets with application. Not that I would really know what happened.
    If you have time, could you tell me if there's an easy fix for this? I would love to have this client/server working if it isn't too much trouble. As I have looked all over the net for a free client/server applet that will actually let me see the java code and none of the free ones do allow getting to their source.
    Most of them allow you to customize them somewhat but also have built in advertising that can't be removed.
    This is the closest I have come to finding one that lets me look under the hood. But alas it doesn't work out of the box and I don't know what to do to fix it.
    Heres the code: Server:
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class Server
      // The ServerSocket we'll use for accepting new connections
      private ServerSocket ss;
      // A mapping from sockets to DataOutputStreams.  This will
      // help us avoid having to create a DataOutputStream each time
      // we want to write to a stream.
      private Hashtable outputStreams = new Hashtable();
      // Constructor and while-accept loop all in one.
      public Server( int port ) throws IOException {
        // All we have to do is listen
        listen( port );
      private void listen( int port ) throws IOException {
        // Create the ServerSocket
        ss = new ServerSocket( port );
        // Tell the world we're ready to go
        System.out.println( "Listening on "+ss );
        // Keep accepting connections forever
        while (true) {
          // Grab the next incoming connection
          Socket s = ss.accept();
          // Tell the world we've got it
          System.out.println( "Connection from "+s );
          // Create a DataOutputStream for writing data to the
          // other side
          DataOutputStream dout = new DataOutputStream( s.getOutputStream() );
          // Save this stream so we don't need to make it again
          outputStreams.put( s, dout );
          // Create a new thread for this connection, and then forget
          // about it
          new ServerThread( this, s );
      // Get an enumeration of all the OutputStreams, one for each client
      // connected to us
      Enumeration getOutputStreams() {
        return outputStreams.elements();
      // Send a message to all clients (utility routine)
      void sendToAll( String message ) {
        // We synchronize on this because another thread might be
        // calling removeConnection() and this would screw us up
        // as we tried to walk through the list
        synchronized( outputStreams ) {
          // For each client ...
          for (Enumeration e = getOutputStreams(); e.hasMoreElements(); ) {
            // ... get the output stream ...
            DataOutputStream dout = (DataOutputStream)e.nextElement();
            // ... and send the message
            try {
              dout.writeUTF( message );
            } catch( IOException ie ) { System.out.println( ie ); }
      // Remove a socket, and it's corresponding output stream, from our
      // list.  This is usually called by a connection thread that has
      // discovered that the connectin to the client is dead.
      void removeConnection( Socket s ) {
        // Synchronize so we don't mess up sendToAll() while it walks
        // down the list of all output streamsa
        synchronized( outputStreams ) {
          // Tell the world
          System.out.println( "Removing connection to "+s );
          // Remove it from our hashtable/list
          outputStreams.remove( s );
          // Make sure it's closed
          try {
            s.close();
          } catch( IOException ie ) {
            System.out.println( "Error closing "+s );
            ie.printStackTrace();
      // Main routine
      // Usage: java Server <port>
      static public void main( String args[] ) throws Exception {
        // Get the port # from the command line
        int port = Integer.parseInt( args[0] );
        // Create a Server object, which will automatically begin
        // accepting connections.
        new Server( port );
    }CLIENT:
    import java.io.*;
    import java.net.*;
    public class ServerThread extends Thread
      // The Server that spawned us
      private Server server;
      // The Socket connected to our client
      private Socket socket;
      // Constructor.
      public ServerThread( Server server, Socket socket ) {
        // Save the parameters
        this.server = server;
        this.socket = socket;
        // Start up the thread
        start();
      // This runs in a separate thread when start() is called in the
      // constructor.
      public void run() {
        try {
          // Create a DataInputStream for communication; the client
          // is using a DataOutputStream to write to us
          DataInputStream din = new DataInputStream( socket.getInputStream() );
          // Over and over, forever ...
          while (true) {
            // ... read the next message ...
            String message = din.readUTF();
            // ... tell the world ...
            System.out.println( "Sending "+message );
            // ... and have the server send it to all clients
            server.sendToAll( message );
        } catch( EOFException ie ) {
          // This doesn't need an error message
        } catch( IOException ie ) {
          // This does; tell the world!
          ie.printStackTrace();
        } finally {
          // The connection is closed for one reason or another,
          // so have the server dealing with it
          server.removeConnection( socket );
    }Thanks for your time.

    CLIENT:
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    public class Client extends Panel implements Runnable
      // Components for the visual display of the chat windows
      private TextField tf = new TextField();
      private TextArea ta = new TextArea();
      // The socket connecting us to the server
      private Socket socket;
      // The streams we communicate to the server; these come
      // from the socket
      private DataOutputStream dout;
      private DataInputStream din;
      // Constructor
      public Client( String host, int port ) {
        // Set up the screen
        setLayout( new BorderLayout() );
        add( "North", tf );
        add( "Center", ta );
        // We want to receive messages when someone types a line
        // and hits return, using an anonymous class as
        // a callback
        tf.addActionListener( new ActionListener() {
          public void actionPerformed( ActionEvent e ) {
            processMessage( e.getActionCommand() );
        // Connect to the server
        try {
          // Initiate the connection
          socket = new Socket( host, port );
          // We got a connection!  Tell the world
          System.out.println( "connected to "+socket );
          // Let's grab the streams and create DataInput/Output streams
          // from them
          din = new DataInputStream( socket.getInputStream() );
          dout = new DataOutputStream( socket.getOutputStream() );
          // Start a background thread for receiving messages
          new Thread( this ).start();
        } catch( IOException ie ) { System.out.println( ie ); }
      // Gets called when the user types something
      private void processMessage( String message ) {
        try {
          // Send it to the server
          dout.writeUTF( message );
          // Clear out text input field
          tf.setText( "" );
        } catch( IOException ie ) { System.out.println( ie ); }
      // Background thread runs this: show messages from other window
      public void run() {
        try {
          // Receive messages one-by-one, forever
          while (true) {
            // Get the next message
            String message = din.readUTF();
            // Print it to our text window
            ta.append( message+"\n" );
        } catch( IOException ie ) { System.out.println( ie ); }
    import java.applet.*;
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    public class ClientApplet extends Applet
      public void init() {
        String host = getParameter( "192.168.1.47" );
        int port = Integer.parseInt( getParameter( "5000" ) );
        setLayout( new BorderLayout() );
        add( "Center", new Client( host, port ) );
    }Sorry about that. Now when I run an html file with this applet I just get the x in the corner.
    Thanks for looking.

Maybe you are looking for

  • Oracle Hyperion Planning 11.1.2.1. hungs Essbase 11.1.2.1.

    Hi All, When end user executing the Calc Manager rule through planning web against our application UPSTPLAN, calc manager rule is getting completed successfully but hangs Essbase application which inturn hangs entire Essbase server. Sometimes Essbase

  • LMS 3.2.1 Backup error

    Hi We have recently installed a new version of LMS 3.2, and everything is working fine. but till now the backup process hasn't started correctly to a directory on our drive D, and once I start a backup process, I recieved the following error ERROR (1

  • Remove duplicates without using Sort OR Script compnent OR Staging ?

    Team , Can some advise on how do we go about removing duplicates without using  either of above option quoted in the subject lines ? My source is a huge  flat file  . Thanks in advance ! Rajkumar Yelugu

  • After install of Acrobat X get error: 1

    What is cause of this error.  It occurs immediately after opening any PDF document

  • Ad hoc query and Sap query

    Hi all What are Ad hod query and sap query? Why we use these two? thanks and regards Seenu