Package org.jscsi.target.connection

Examples of org.jscsi.target.connection.TargetSession


                    /*
                     * TODO get (new or existing) session based on TSIH But since we don't do session reinstatement and
                     * MaxConnections=1, we can just create a new one.
                     */
                    TargetSession session = new TargetSession(this, connection, initiatorSessionID, parser.getCommandSequenceNumber(),// set
                                                                                                                                      // ExpCmdSN
                                                                                                                                      // (PDU
                                                                                                                                      // is
                                                                                                                                      // immediate,
                                                                                                                                      // hence
                                                                                                                                      // no
                                                                                                                                      // ++)
                    parser.getExpectedStatusSequenceNumber());

                    sessions.add(session);
                    // threadPool.submit(connection);// ignore returned Future
                    connection.call();
                } catch (DigestException | InternetSCSIException | SettingsException e) {
                    LOGGER.info("Throws Exception", e);
                    continue;
                }
            }
        } catch (IOException e) {
            // this block is entered if the desired port is already in use
            LOGGER.error("Throws Exception", e);
        }

        System.out.println("Closing socket channel.");
        serverSocketChannel.close();
        for(TargetSession session: sessions){
            System.out.println("Commiting uncommited changes.");
            session.getStorageModule().close();
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.jscsi.target.connection.TargetSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.