Client disconnection notification for NIO server

A server accepts connections from clients and registers accepted channels for reading:
while (true)
    if (selector.select()>0)
        Iterator<SelectionKey> iterator = selector.selectedKeys().iterator();
        while(iterator.hasNext())
            SelectionKey opKey = iterator.next();
            iterator.remove();
            if (opKey.isAcceptable())
                clientSocketChannel = serverSocketChannel.accept();
                clientSocketChannel.configureBlocking(false);
                clientSocketChannel.register(selector, SelectionKey.OP_READ);
. . .One of the server's clients disconnects from it by means of socketChannel.close() while the servert is locked with selector.select() (that is the server have nothing to read from its clients and nobody is connecting to it).Will the server be unlocked when the client performs socketChannel.close()? If so, what notification/exception will the server receive?

One of the server's clients disconnects from it by means of socketChannel.close() while the servert is locked with selector.select()The select() will immediately return; the corresponding channel will be readable; and the read() will return -1.

Similar Messages

  • Creation of disconnection notification for the disconnection document

    Hi,
    I created a disconnection document using FM ISU_S_DISCDOC_CREATE for the installation. Now i have to create the disconnection notification for the disconnection document. Is there any FM to do that.
    Regards,
    Mukesh Kumar

    hi
    i  dnt think there s a seperate fm  for creating   notif specially  for disconn notification..
    kr
    raj

  • O.S. / Hard Drive Size for NIO Server/Client's load testing...

    Hi All
    I am currently load testing a NIO Server/Client's to see what would be the maximum number of connections that could reached, using the following PC: P4, 3GHz, 1GB RAM, Windows XP, SP2, 110 GB Hard Drive.
    However, I would like to test the Server/Client performance on different OS's:
    Which would be the best possible option from the following:
    1. Partition my current drive, (using e.g. Partition Magic), to e.g.
    - Win XP: 90 GB
    - Win Server 2000: 10 GB
    - Linux: 5 GB
    - Shared/Data: 5 GB
    2. Install a separate Hard drive with the different hard drives
    3. Use a disk caddie, to swap in/out test hard drives.
    4. Any thing else?
    - Would the Operating System's hard drive size affect the Server/Client's performance, e.g. affecting the number of connections, number of File Handles, the virtual memory, etc.?
    Many Thanks,
    Matt

    You can use a partition on the same HDD or use a second HDD, disk caddie well if its a direct IDE or SCSI. If its usb no it will be too slow, may be if you have a fire-wire but I still don't recommend it.
    Be careful if you don't have any experience installing Linux you may do multiple partitions on you disk without knowing, because Linux ext partitions are not visible to windows.
    Recommended disk size for fedora is 10 GB. This is the amount of data that will be created on you HDD when you do a full installation.

  • How to setup the 'Client Licensing Mode' for Windows server?

    Hello,
    We will install the SBO server:
    OS: Windows Server 2003 Standard Edition
    SBO Clients: 150
    How should we setup the 'Client Licesing Mode' for the windows server?
    If we select the mode "Per server,Number of concurrent connections", how to set the connection number?
    Thanks in advance.
    Don

    Hi..
    you can set License to Particular user using License under Administration and Client will automatically fetch License using License Manager on License Server
    Regards,
    Bhavank

  • Howto for install Oracle Client or ODAC for W2k8R2?

    Hi all!
    I want know if it gives a Oracle Docu for installing Oracle Client or ODAC for Windows Server 2008 R2 64bit. I have a MS SQL 2008 Server and want make a linked Server to an Oracle 10g RAC-Database (10.2.0.4) and want know if i must only install the Oracle Client or did i also need ODAC?? And i have read, that it is better to install by the Client 32bit and 64bit from Oracle Client. So what is the best way to make a linked Oracle-Server on my MS-SQL 2008 on Windows 2008 R2? Hope someone have a positiv answer. Thx
    Greetz
    Franco

    Hi,
    No, you don't need to download the Grid Client infraestructure file. That's a tool to install on servers.
    The problem is that you are downloading a version of 11.2 in 64 bits, and 11.1 in 32 bits. So maybe they hay changed something between 11.1 and 11.2 that you dislike.
    You could download the 64bit version of 11.1 client, but however, you can manually create a tnsnames.ora if you want. You could use netca for that purpose.
    Regards,
    Mario Alcaide
    http://marioalcaide.wordpress.com

  • Common reason for Mirage Server Failure in Clustered Environment and how clients will be switched to other server in a cluster

    Hi,
    Can Anybody share me the information regarding Common reason for Mirage Server Failure in Clustered Environment.
    And how clients will be switched to other server in a cluster to continue their operations from the failed server.
    Regards,
    Bathesha C

    Hello,
    if you have more than one mirage server configured with Load balancing (LB or MSFTNLB) the client would disconnect from the faulting server and then reconnect to an other server to progress with the action as before.
    All Mirage server are stateless and share the same SIS (single instance store) so any server can update or create CVD file set for an client.
    Hope that helps.

  • Asking about how server can handle client disconnection

    Dear sir/madam,
    i'm doing my final year project and it is about a java client/server big2 game.But now i have a difficulties in dealing with the server side.
    That is about how to take action on the serverside if the client suddenly disconnected.
    I have read many java client/server programming scripts.But all of them doesn't mention this problem.The scrpits only assume the client side never disconnect suddenly.
    I hope if you can give me some suggestions on this problem.

    For my mud written in java, I used TCP/IP for the connections. When a client connects, he gets his own thread. Those threads are held in a vector in a manager class. each tick of the server does a quick run thru the vector and if the current thread/socket its on is null or !isAlive() its remove from the vector(which in turn removes it from getting any more game updates. This removal can be caused by two things. The clients disconnects by accident(kills his game, locks up has an internet connection hiccup, etc.) or he uses the games "quit" method. The quit method calls a method that does any player saving of data, etc then closes the socket, and sets it to null. thus the manager sees this and removes him frm the vecotr list on the next server tick. Seems to work great form a mud and worked really well in a multiplayer applet game I had up for a while.

  • Echo to all clients connected to NIO server

    I am writing a NIO xml socket server that uses NIO.
    My model implemensts a producer / consumer system where client connections are accepted and processed by a specified number of worker threads.
    I would like to be able to broadcast a message to all clients that are connected to the server.
    Opinions / suggestions I am sure that this is quite a common type of functionality.
    Kind Regards

    Accendia server is implementing a callback mechanism that allows the server to notify the client.
    This is not broadcast, you would have to call each client (www.accendia.com). For real broadcasting use datagram or multicast sockets (depends on different factors) on both client and server in addition to the sockets used as part of the NIO server.

  • Server to detect client disconnection "Sockets"

    i want to know how it is possible for a server to find out when the client is disconnected at any instance. not only at the time of sending data...
    i am writing a server that should communicate with different clients, and i want it to be able to find out if a client suddenly disconnects or crashes, so how can this be done?!
    is it this way:
    skt.setKeepAlive(true);the problem is that SO_KEEPALIVE checks after 2 hours, which is too much time, how can i change this value????

    So, i want to be able to find out if the client is disconnected without waiting to send or receive data.Use a read timeout.
    how can i change the value of SO_KEEPALIVEYou can't. It is two hours by default and requires privilege to change it, and changing it is system-wide. So you don't want to do that.
    Use a read timeout. Socket.setSoTimeout().

  • How can I Create a Client Configuration File for RemoteApp and Desktop Connection with Server 2012?

    I have a working RDS RemoteApp site and looking to test out the feature in Windows 7 Control Panel\All Control Panel Items\RemoteApp and Desktop Connections
    I came across this link: Create a Client Configuration File for RemoteApp and Desktop Connection and I believe this is what I need to do first, but these instructions are for
    Server 2008, and I'm running 2012.
    Any suggestions or tips on how I can begin testing this with Server 2012?

    Hi,
    You can manually enter the path to the 2012 feed and it will connect and download the RemoteApps and Desktop connections.
    If you need a sample .wcx file I have posted one here a couple of times.  If you want I will look for it and post a link.
    -TP
    I tried adding my URL's below, these are sample links that work for me right now for when I log into the web page, but neither of these work.  And I'm not sure what I would need to do with or how to create a .wcx file.
    When I type in my URL of: https://connect.mydomain.org/RDWeb, I get redirected to: 
    https://connect.mydomain.org/RDWeb/Pages/en-US/login.aspx?ReturnUrl=/RDWeb/Pages/en-US/Default.aspx

  • REMOTE DESKTOP SERVICES CLIENT ACCESS LICENSES FOR MICROSOFT WINDOWS SERVER 2012 STANDARD AND DATACENTER

    I am using a window 7 professional  service pack 1 and I purchase REMOTE DESKTOP SERVICES CLIENT ACCESS LICENSES FOR MICROSOFT WINDOWS SERVER 2012 STANDARD AND DATACENTER. but  the seller did not send me any installation CD or instruction
    on how to use it.
     Please how can I use it on my window 7 professional  service pack 1.
    Thank you.

    Though Bill is absolutely correct for most CALs, Remote Desktop Services does have its own special licensing server.  I haven't installed one on 2012, yet, but here is a step-by-step guide for 2008. 
    http://technet.microsoft.com/en-us/library/dd983943(v=ws.10).aspx
    Here is a lab guide for 2012 -
    http://technet.microsoft.com/en-us/library/jj134160.aspx
    But, the explanation of your environment begs the question - what are you trying to do?  You say you have a desktop OS and you are talking about Windows Server products.  In that light, your question does not make a lot of sense.
    . : | : . : | : . tim

  • Inbound Adapter / 'Sink' failing for Content Server on Subscription Client

    I am running into an issue in configuring the Outbound - Inbound Adapters for Connection Server / Subscription Client against Content Server. The details are below. Would sincerely appreciate if anyone can help with this.
    I have installed a Oracle UCM setup together with two Content Server instances (Contribution instance and Live instance), a Connection Server and a Subscription Client - all within the same virtual machine on top of Windows XP SP2 OS and Oracle 10g Database.
    I have further configured the Outbound Adapter on the Connection Server and the Inbound Adapter on the Subscription Client. All installation and configuration has been done following the step-by-step process from the relevant installation guides.
    We have tested the connectivity between the Connection Server and the Subscription Client for a simple file-based content source and it works fine - i.e., files added to a directory registered as a source on connection server are retrieved and sent to the subscription client and received there successfully / dropped in the specified target client directory.
    However, this transfer fails for the Content Server Outbound-Inbound Adapter connectivity. We have an Archive in Content Server registered as a "CNSArchive" and exporting successfully to the CNS Server. The registered outbound adapter is successfully able to receive these updates and are visible through the Connection Server
    interface. The subscription client is also apparently able to receive these updates
    correctly and writes them to the specified folder/directory on the client;
    however fails to "batch load" these and reports a failure writing to the
    Content Sink.
    What we would like is for the ability to establish end-to-end connectivity between the contribution content server instance and the live content server using the connection server + outbound adapter on the sending end together with the subscription client + inbound adapter together on the receiving end. This is failing.
    I have double checked the cns.oracle.config (connection server config), siclone.config (subscription client config), and the source content server's configuration (config.cfg), and all seems to be well. Not really sure therefore what is causing this.
    Here is a snippet of the error trace that keeps showing up in the subscription client logs ...
    [May 18 21:18:34] VERBOSE: scheduler: waiting to run job ICE Connection in 0:00:33.000 ...
    [May 18 21:18:34] VERBOSE: replicator: response: 200 OK for Url:http://192.168.131.65:8891/42/E%3a%2fapps%2foracle%2fucm%2fserver%2fweblayout%2fgroups%2fpublic%2fdocuments%2fucmdocs%2fcpseven.pdf
    [May 18 21:18:34] INFO: replicator: opened connection http://192.168.131.65:8891/42/E%3a%2fapps%2foracle%2fucm%2fserver%2fweblayout%2fgroups%2fpublic%2fdocuments%2fucmdocs%2fcpseven.pdf in 0:00:00.130
    [May 18 21:18:34] ERROR: replicator: ContentSink reported failure to add item.
    [May 18 21:18:34] ERROR: replicator: Telling all sinks to rollback changes
    [May 18 21:18:34] ERROR: replicator: crawl failed
    [May 18 21:18:34] VERBOSE: scheduler: job completed:ICE Request: 43

    Don't know if anyone is still having problems with this, but just in case...
    I was getting a similar error. I had an Event Viewer record (It wasn't a Warning or an Error, just an Information) reading:You are running a version of Microsoft SQL Server 2000 or Microsoft SQL Server 2000 Desktop Engine (also called MSDE) that has known security vulnerabilities when used in conjunction with this version of Windows. To reduce your computer's vulnerability to certain virus attacks, the TCP/IP and UDP network ports of Microsoft SQL Server 2000, MSDE, or both have been disabled. To enable these ports, you must install a patch, or the most recent service pack for Microsoft SQL Server 2000 or MSDE from http://www.microsoft.com/sql/downloads/default.asp
    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
    I installed SQL SP4 and it corrected the problem

  • Using Exchange Web Service (EWS) Streaming Notifications for a shared mailbox in Exchange Server, works or not?

    Hi,
    I am planning to develop an application to use EWS managed API streaming notification for listening the new email event of a shared mailbox. Will it will work or not? I knew it works for a personal mailbox, where the authentication of EWS can be performed
    with the associated Active directory account. For the shared mailbox in Exchange Server, is there such an Active Directory account associated?
    Thanks,
    Richard

    >> Are you saying that if an Active Directory account has the access to a shared mailbox, and then this account can be used for creating the Streaming subscription for that mailbox
    Yes that's correct (try it yourself with the EWSEditor)
    >> In other words, the way how Exchange Server works is that the new messages like new emails are automatically sending to all of the AD accounts which have the access to a mailbox.
    Not sure what you mean by this ? A Shared a Mailbox is just like any other Exchange Mailbox if you have rights to the Folder then you can create a subscription against it. There is no automation involved.
    Cheers
    Glen

  • Streaming Notifications for a shared mailbox in Exchange Server, works or not?

    Hi,
    I am planning to develop an application to use EWS managed API streaming notification for listening the new emails of a shared mailbox. Could you please tell it will works or not? I knew it works for a personal mailbox, where the authentication of EWS can
    be performed with the associated Active directory account. For the shared mailbox in Exchange Server, how it works?
    Thanks,
    Richard

    If you are using EWS to access a mailbox other than the one connected to a specific account, you will want to check out EWS impersonation.  I've found it to be more reliable than any other method for accessing a second mailbox.

  • Java server showing recieved messages after client disconnects?

    I just found a MMORPG creation software, but it was too limited for me to do what I wanted. So not, here I am, and I want to make my own server. I decided Java would be the best for this because of its easy thread creation.
    Now I have some simple test code that doesn't work like I would think it should. I made a simple client in Flash Player 9 which can send messages to my server. My server is supposed to recieve the messages as they come, and System.out.println them immediately. However, my server only prints the messages recieved after the client shuts down the socket.
    Here is the code for the server, it is very simple, and just a test:
    import java.io.*;
    import java.net.*;
    public class ServerMgr
         public static void main(String[] args)
              ServerSocket servsock;
              Socket s;
              BufferedReader in;
              try
                   servsock = new ServerSocket(4444);
                   s = servsock.accept();
                   System.out.println("Accepted Connection!");
                   in = new BufferedReader(
                             new InputStreamReader(s.getInputStream()));
                   String input = "";
                   while((input = in.readLine()) != "stop")
                        if(input != null)
                             System.out.println(input);
                        if(input == "stop")
                             break;
                   in.close();
                   s.close();
                   servsock.close();
              catch(IOException e)
    }Thanks in advance for any help.

    Since you are reading lines in your server you must make sure your client sends lines i.e. text is terminate by \n or \r\n.
    P.S. Exception handling like yours is considered criminal by me and many others.

Maybe you are looking for

  • Sorry, a serious error has occurred that requires Adobe Premier Elements to shut down.

    I have Adobe Premier Elements 7. When I launch the application then try to begin using it an error is presented which advises Sorry, a serious error has occurred that requires Adobe Premier Elements to shut down. We will attempt to save your current

  • Dropdown box advanced item

    Greetings all. I am using Acrobat X on a mac and I want to add a dropdown box to a medical lad form which would contain a list of Doctors names and when I select a name from the dropdown box, their contact info and phone number will be shown either b

  • MDM 5.5 installed in Netweaver/Abap instance MCOD

    Since MDM 5.5 install guide does not include Oracle as part of the installation (the installation is not SAPINST based), I installed MDM servers connecting to a netweaver/Abap instance that got installed separately, so in this case my MDM installatio

  • Regarding Idoc scenario....

    Hi Gurus, Could any one explain what are the configurations required for idoc to file scenario ? i have configured every thing, with defining a logical system, assigning a logical system, creating port and partner profile and i am getting confusing a

  • Why am i getting hyperlinks without using a /a tags?

    Im using Dreamwever6 and im very new at this. I have code showing up as a link when i preview it but there is no anchor tag set for a link.  I've previewed in Safari, Fire Fox, and Chrome.  I've included the html below.  The lines that display incore