Working With Sockets Using A Single Thread

Nokia phones appear to have a major problem with its J2ME implementation; access a socket with more than one thread causes the MIDlet to crash. After much thought I came up with a solution:
   private class Event {
     byte[] buffer;
    /** The event queue (yeah I know it is a stack) */
    Stack eventQueue = new Stack();
    /** The input stream */
    public DataInputStream sin;
    /** The output stream*/
    public OutputStream sout ;
    public void run() {
         while(running) {
          // send outgoing events
          while( running && sin.available() == 0 ) {
              while( !eventQueue.empty() ) {
               Event e = (Event)eventQueue.pop();
               sout.write( e.buffer );
               sout.flush();
              Thread.currentThread().yield();
          // process incoming events
    }But the flipping thing never goes into the "processing incoming events" section on real Nokia phones (works fine on the WTK thou). I'm guessing sin.available() is always returning 0.
Can anyone else think of a way round this (keeping in mind I don't know when data is coming, and read() blocks).

It sound like the while loop is locking out the socket read, almost like the yeild wasn't working. But you said teh threading was broken. Does a very short sleep help, is the shortest real timer interval 18.2 hertz = 55 millisecond?

Similar Messages

  • Help! My application uses a Single Thread !

    Hi all !
    I have a web application which performs some long running tasks. This can be easily simulated with:
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              System.out.println("Started Long Running Task!");
              try {
                   Thread.sleep(20000);
              } catch (InterruptedException e) {
                   e.printStackTrace();
              System.out.println("Done");
    In order to deal with Long Running Tasks, I have created a WorkManager with MinThreads 10 and MaxThreads 100
    Then I have assigned the Work Manager to the Web application usign weblogic.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90">
    <wl-dispatch-policy>WorkManager-0</wl-dispatch-policy>
    </weblogic-web-app>
    However it seems that the Web application uses a SINGLE Thread to reply to the Servlet. In other words issuing n parallel requests the output is:
    Started Long Running Task!
    [20 Seconds Pause]
    Started Long Running Task!
    [20 Seconds Pause]
    Started Long Running Task!
    [20 Seconds Pause]
    Started Long Running Task!
    [20 Seconds Pause]
    My settings are the default Weblogic 12c Server settings, I've just added Weblogic NIO performance libs to the Java's path.
    Is there any setting which allow just 1 Socket for my application ? Maybe it's because I'm using the "unlicensed" (free download) server version ?
    Thanks a lot
    Frank

    You need to create separate Windows user accounts if you want to seperate the behaviour of iTunes for each user. That also means separate iTunes libraries for each user.
    Windows is a multi-user operating system but you are not using it properly. iTunes is not a multi-user application. No application is. You can't expect it to treat different users differently when they are all using the same computer user account.
    Do you understand what I mean?

  • Error when working with TableView using JCA

    Hi sdns,
    I am getting an iview rutnime error when working with Tableview using JCA. Here i am putting all my code, go thorugh it and tell me if any error is there.One more thing is Usermappping and all properties are set to system object.
    Now you can throught he code which is followed by error also.
    <u>Java file.</u>
    public class DisplayComponent extends PageProcessorComponent {
         public DynPage getPage() {
              return new DisplayComponentDynPage();
         public static class DisplayComponentDynPage extends JSPDynPage {
              private JCATviewBean bean;
              public void doInitialization() {
                   IPortalComponentProfile profile =
                        ((IPortalComponentRequest) getRequest())
                             .getComponentContext()
                             .getProfile();
                   Object o = profile.getValue("myBean");
                   if (o == null || !(o instanceof JCATviewBean)) {
                        bean = new JCATviewBean();
                        profile.putValue("myBean", bean);
                   } else {
                        bean = (JCATviewBean) o;
                   // fill your bean with data here...
                   IPortalComponentRequest request =
                        (IPortalComponentRequest) this.getRequest();
                   doJca(request);
              public void doProcessAfterInput() throws PageException {
              public void doProcessBeforeOutput() throws PageException {
                   this.setJspName("Report.jsp");
              private IConnection getConnection(
                   IPortalComponentRequest request,
                   String alias)
                   throws Exception {
                   IConnectorGatewayService cgService =
                        (IConnectorGatewayService) PortalRuntime
                             .getRuntimeResources()
                             .getService(
                             IConnectorService.KEY);
                   ConnectionProperties prop =
                        new ConnectionProperties(
                             request.getLocale(),
                             request.getUser());
                   return cgService.getConnection(alias, prop);
              public void doJca(IPortalComponentRequest request) {
                   IConnectionFactory connectionFactory = null;
                   IConnection client = null;
                   String rfm_name = "BAPI_COMPANYCODE_GETLIST";
                   try {
                        try {
                             //       pass the request & system alias
                             //       Change the alias to whatever the alias is for your R/3 system
                             client = getConnection(request, "MyIDES");
                        } catch (Exception e) {
                             System.out.println(
                                  "Couldn't establish a connection with a target system.");
                             return;
    Start Interaction
                        IInteraction interaction = client.createInteractionEx();
                        IInteractionSpec interactionSpec =
                             interaction.getInteractionSpec();
                        interactionSpec.setPropertyValue("Name", rfm_name);
    CCI api only has one datatype: Record
                        RecordFactory recordFactory = interaction.getRecordFactory();
                        MappedRecord importParams =
                             recordFactory.createMappedRecord(
                                  "CONTAINER_OF_IMPORT_PARAMS");
                        IFunctionsMetaData functionsMetaData =
                             client.getFunctionsMetaData();
                        IFunction function = functionsMetaData.getFunction(rfm_name);
                        if (function == null) {
                             System.out.println(
                                  "Couldn't find " + rfm_name + " in a target system.");
                             return;
    How to invoke Function modules
                        System.out.println("Invoking... " + function.getName());
                        MappedRecord exportParams =
                             (MappedRecord) interaction.execute(
                                  interactionSpec,
                                  importParams);
    How to get structure values
                        IRecord exportStructure = (IRecord) exportParams.get("RETURN");
                        String columnOne = exportStructure.getString("TYPE");
                        String columnTwo = exportStructure.getString("CODE");
                        String columnThree = exportStructure.getString("MESSAGE");
                        System.out.println("  RETURN-TYPE    = " + columnOne);
                        System.out.println("  RETURN-CODE    = " + columnTwo);
                        System.out.println("  RETURN-MESSAGE =" + columnThree);
    How to get table values
                        IRecordSet exportTable =
                             (IRecordSet) exportParams.get("COMPANYCODE_LIST");
                        exportTable.beforeFirst();
                        // Moves the cursor before the first row.
                        while (exportTable.next()) {
                             String column_1 = exportTable.getString("COMP_CODE");
                             String column_2 = exportTable.getString("COMP_NAME");
                             System.out.println(
                                  "  COMPANYCODE_LIST-COMP_CODE = " + column_1);
                             System.out.println(
                                  "  COMPANYCODE_LIST-COMP_NAME = " + column_2);
                        //       create the tableview mode in the bean
                        bean.createData(exportTable);
    Closing the connection
                        client.close();
                   } catch (ConnectorException e) {
                        //       app.putValue("error", e);
                        System.out.println("Caught an exception: \n" + e);
                   } catch (Exception e) {
                        System.out.println("Caught an exception: \n" + e);
    <u>Bena file</u>
    package com.sap.JCA.bean;
    import java.util.Vector;
    import com.sapportals.connector.execution.structures.IRecordSet;
    import com.sapportals.htmlb.table.DefaultTableViewModel;
    import com.sapportals.htmlb.table.TableViewModel;
    public class JCATviewBean {
         public DefaultTableViewModel model;
         public TableViewModel getModel() {
         return this.model;
         public void setModel(DefaultTableViewModel model) {
         this.model = model;
         public void createData(IRecordSet table) {
    //       this is your column names
         Vector column = new Vector();
         column.addElement("Company Code");
         column.addElement("Company Name");
    //       all this logic is for the data part.
         Vector rVector = new Vector();
         try {
         table.beforeFirst();
         while (table.next()) {
         Vector data = new Vector();
         data.addElement(table.getString("COMP_CODE"));
         data.addElement(table.getString("COMP_NAME"));
         rVector.addElement(data);
         } catch (Exception e) {
         e.printStackTrace();
    //       this is where you create the model
         this.setModel(new DefaultTableViewModel(rVector, column));
    <b>JSP File:</b>
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <jsp:useBean id="myBean" scope="application" class="com.sap.JCA.bean.JCATviewBean" />
    <hbj:content id="myContext" >
      <hbj:page title="PageTitle">
       <hbj:form id="myFormId" >
       <br>
       <hbj:textView id = "tv1" text = "<b>TableView Example Using JCA</b> <br>"/>
    <hbj:tableView
        id="myTableView1"
        model="myBean.model"
        design="ALTERNATING"
        headerVisible="true"
        footerVisible="true"
        fillUpEmptyRows="true"
        navigationMode="BYLINE"
        selectionMode="MULTISELECT"
        headerText="TableView example1"
        visibleFirstRow="1"
        visibleRowCount="30"
        width="500 px"
        />
       </hbj:form>
      </hbj:page>
    </hbj:content>
    <b>Error when Executing this component:</b><u></u>
      Portal Runtime Error
    <b>An exception occurred while processing a request for :
    iView : N/A
    Component Name : N/A
    com/sapportals/portal/htmlb/page/PageProcessorComponent.
    Exception id: 12:21_28/10/05_0173_94105150
    See the details for the exception ID in the log file</b>  
    If anybody find the error please reply to this post.
    Regards,
    sireesha.

    Thanks for your response Martin,
    I have already seen the log file but im couldn't findout anything from that since it is so long here im putting some part of please see this.if u able to find it clarify me,
    <b>Here the log file:</b>
    1.5#001321FD6213005D0000907100001CB000040419258FBF4E#1130405957843#trexr3.com.sapmarkets.isa.services.schedulerservice.persistence.jdo.DataBaseJobStore#sap.com/crm.trexr3#trexr3.com.sapmarkets.isa.services.schedulerservice.persistence.jdo.DataBaseJobStore#J2EE_ADMIN#530##obtdev3_O09_94105150#Guest#8a2bbd20444711da932c001321fd6213#Thread[SchedulerThread,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#/System/Scheduler/JobStore#Plain###With in the acquireLockForNextAvailableJob DataStore#
    #1.5#001321FD6213005D0000907200001CB00004041925916735#1130405957953#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#sap.com/crm.trexr3#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#J2EE_ADMIN#530##obtdev3_O09_94105150#Guest#8a2bbd20444711da932c001321fd6213#Thread[SchedulerThread,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#/System/Scheduler#Plain###Acquired the job null#
    #1.5#001321FD6213005D0000907300001CB0000404192591688D#1130405957953#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#sap.com/crm.trexr3#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#J2EE_ADMIN#530##obtdev3_O09_94105150#Guest#8a2bbd20444711da932c001321fd6213#Thread[SchedulerThread,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#/System/Scheduler#Plain###Did not find any job.So, Waiting for sometime for the next job#
    #1.5#001321FD621300650000120E00001CB00004041925C953D7#1130405961625#com.sap.aii.af.sample.adapter.ra.SPIManagedConnectionFactory##com.sap.aii.af.sample.adapter.ra.SPIManagedConnectionFactory.XIManagedConnectionFactoryController.run()######04d7f690469311da8d52001321fd6213#Thread[Thread-114,5,SAPEngine_System_Thread[impl:5]_Group]##0#0#Debug#1#/Applications/ExchangeInfrastructure/AdapterFramework/ThirdPartyRoot/comsap/Server/Adapter Framework#Java###MCF with GUID is running. (,)#3#964bfca0444711dabb51001321fd6213#com.sap.engine.services.deploy.server.ApplicationLoader@1586c77#964bfca0444711dabb51001321fd6213#
    #1.5#001321FD6213005D0000907400001CB000040419275B24FC#1130405987953#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#sap.com/crm.trexr3#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#J2EE_ADMIN#530##obtdev3_O09_94105150#Guest#8a2bbd20444711da932c001321fd6213#Thread[SchedulerThread,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#/System/Scheduler#Plain###within the infinite of the Scheduler Thread#
    #1.5#001321FD6213005D0000907500001CB000040419275B25D9#1130405987953#trexr3.com.sapmarkets.isa.services.schedulerservice.persistence.jdo.DataBaseJobStore#sap.com/crm.trexr3#trexr3.com.sapmarkets.isa.services.schedulerservice.persistence.jdo.DataBaseJobStore#J2EE_ADMIN#530##obtdev3_O09_94105150#Guest#8a2bbd20444711da932c001321fd6213#Thread[SchedulerThread,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#/System/Scheduler/JobStore#Plain###With in the acquireLockForNextAvailableJob DataStore#
    #1.5#001321FD6213005D0000907600001CB000040419275B2E27#1130405987953#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#sap.com/crm.trexr3#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#J2EE_ADMIN#530##obtdev3_O09_94105150#Guest#8a2bbd20444711da932c001321fd6213#Thread[SchedulerThread,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#/System/Scheduler#Plain###Acquired the job null#
    #1.5#001321FD6213005D0000907700001CB000040419275B2EFA#1130405987953#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#sap.com/crm.trexr3#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#J2EE_ADMIN#530##obtdev3_O09_94105150#Guest#8a2bbd20444711da932c001321fd6213#Thread[SchedulerThread,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#/System/Scheduler#Plain###Did not find any job.So, Waiting for sometime for the next job#
    #1.5#001321FD6213005D0000907800001CB0000404192924ED59#1130406017953#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#sap.com/crm.trexr3#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#J2EE_ADMIN#530##obtdev3_O09_94105150#Guest#8a2bbd20444711da932c001321fd6213#Thread[SchedulerThread,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#/System/Scheduler#Plain###within the infinite of the Scheduler Thread#
    #1.5#001321FD6213005D0000907900001CB0000404192924EE36#1130406017953#trexr3.com.sapmarkets.isa.services.schedulerservice.persistence.jdo.DataBaseJobStore#sap.com/crm.trexr3#trexr3.com.sapmarkets.isa.services.schedulerservice.persistence.jdo.DataBaseJobStore#J2EE_ADMIN#530##obtdev3_O09_94105150#Guest#8a2bbd20444711da932c001321fd6213#Thread[SchedulerThread,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#/System/Scheduler/JobStore#Plain###With in the acquireLockForNextAvailableJob DataStore#
    #1.5#001321FD6213005D0000907A00001CB0000404192924F652#1130406017953#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#sap.com/crm.trexr3#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#J2EE_ADMIN#530##obtdev3_O09_94105150#Guest#8a2bbd20444711da932c001321fd6213#Thread[SchedulerThread,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#/System/Scheduler#Plain###Acquired the job null#
    #1.5#001321FD6213005D0000907B00001CB0000404192924F710#1130406017953#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#sap.com/crm.trexr3#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#J2EE_ADMIN#530##obtdev3_O09_94105150#Guest#8a2bbd20444711da932c001321fd6213#Thread[SchedulerThread,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#/System/Scheduler#Plain###Did not find any job.So, Waiting for sometime for the next job#
    #1.5#001321FD621300650000120F00001CB000040419295CCD8B#1130406021625#com.sap.aii.af.sample.adapter.ra.SPIManagedConnectionFactory##com.sap.aii.af.sample.adapter.ra.SPIManagedConnectionFactory.XIManagedConnectionFactoryController.run()######04d7f690469311da8d52001321fd6213#Thread[Thread-114,5,SAPEngine_System_Thread[impl:5]_Group]##0#0#Debug#1#/Applications/ExchangeInfrastructure/AdapterFramework/ThirdPartyRoot/comsap/Server/Adapter Framework#Java###MCF with GUID is running. (,)#3#964bfca0444711dabb51001321fd6213#com.sap.engine.services.deploy.server.ApplicationLoader@1586c77#964bfca0444711dabb51001321fd6213#
    #1.5#001321FD6213005D0000907C00001CB0000404192AEEB1E2#1130406047953#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#sap.com/crm.trexr3#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#J2EE_ADMIN#530##obtdev3_O09_94105150#Guest#8a2bbd20444711da932c001321fd6213#Thread[SchedulerThread,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#/System/Scheduler#Plain###within the infinite of the Scheduler Thread#
    #1.5#001321FD6213005D0000907D00001CB0000404192AEEB2C0#1130406047953#trexr3.com.sapmarkets.isa.services.schedulerservice.persistence.jdo.DataBaseJobStore#sap.com/crm.trexr3#trexr3.com.sapmarkets.isa.services.schedulerservice.persistence.jdo.DataBaseJobStore#J2EE_ADMIN#530##obtdev3_O09_94105150#Guest#8a2bbd20444711da932c001321fd6213#Thread[SchedulerThread,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#/System/Scheduler/JobStore#Plain###With in the acquireLockForNextAvailableJob DataStore#
    #1.5#001321FD6213005D0000907E00001CB0000404192AEEBAD8#1130406047968#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#sap.com/crm.trexr3#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#J2EE_ADMIN#530##obtdev3_O09_94105150#Guest#8a2bbd20444711da932c001321fd6213#Thread[SchedulerThread,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#/System/Scheduler#Plain###Acquired the job null#
    #1.5#001321FD6213005D0000907F00001CB0000404192AEEBB9E#1130406047968#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#sap.com/crm.trexr3#trexr3.com.sapmarkets.isa.services.schedulerservice.SchedulerThread#J2EE_ADMIN#530##obtdev3_O09_94105150#Guest#8a2bbd20444711da932c001321fd6213#Thread[SchedulerThread,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#/System/Scheduler#Plain###Did not find any job.So, Waiting for sometime for the next job#

  • SSO doesn't work with Xcelsius using QAAWS, outside Infoview

    Hi,
    We have some xcelsius dashboards using QAAWS to retrieve data from database
    I would like to know whether SSO works with xcelsius dashboards using QAAWS outside infoview.Currently we get login screen to enter username/password.we are using Windows AD as the authentication type in the environment.

    You got it right. Within the InfoView, your Xcelsius-swf gets the CELogonToken as a parameter field to authenticate against the data for example. If you access another Xcelsius-Dashboard from within a swf you can even pass the LogonToken on.
    Using dashboard and QaaWS outside of InfoView, the user will have to enter username and password before the data is fetched. At least that is the way it works here.
    Regards,
    Peter

  • How to work with BI using Visual Composer....?

    Hi
    I want to work with BI report and BEx analyzer etc using  Visual Composer.
    I am using Visual Composer 7.1. I  have configured BI system connection using the following link
    http://help.sap.com/saphelp_nwce10/helpdata/en/7e/6dbcea3700452195e3bddaa47c5906/frameset.htm.
    In the above document i didnt understand the following para....
    Creating BI Users in the Portal
    Ensure that the BI back-end users also exist in the J2EE Engine. You can use the BI back end as the user store for the J2EE Engine or you can create the users manually. If you create the users manually, you should ensure that they have the same names as in the BI back-end; this avoids the need to configure user assignment.
    How to check BI back end user also exist in J2EE engine ?
    How to use BI kit in Visual composer. From where can i download BI kit for Visual Composer.
    What is the difference between developing application in VC using the above method and using BI kit.
    Please help me....
    Regards
    Sowmya....

    Hi,
    Without the BI kit you cannot do a lot of things in VC 7.1.
    This kit is not available with 7.1.
    The part that you did not understand meant that if you opening VC using a certain id in portal for eg "user" then the same id should be present in your backend system in this case BW system.
    Without this it wont be able to connect to the system.
    Hope this helps
    Regards
    Nikhil.
    Reward points if you find the answer helpful

  • Working with margins on a single page

    I inserted a table and can't change my margins to make the table fit on one page without adjusting the margins on all the other pages. How do I isolate a single page and work with it apart from the rest of the document? I've tried Section Break and that doesn't work.

    Jerrold Green1 wrote:
    There is an exception to, or workaround for, the Margins being a global (Document Inspector) setting that you might appreciate being aware of. When you need to increase the size of the margins temporarily or for the balance of the document, you can insert a Layout Break and go to the Layout Inspector to further increase the margin space. You can't make the margins smaller there (as would be required for your immediate problem), only larger.
    Hi Jerrold
    thank for the reminder, I forgot this feature.
    Yvan KOENIG (VALLAURIS, France.) jeudi 13 août 2009 16:35:25

  • Flash player not working with Facebook using IE 11

    I got a new computer windows 8.1 but flash player wont work with facebook; it keeps telling me to install flashplayer.  It is installed.  I verified that it is enable in add-ons and also Active x is turned off.  still wont play videos from facebook.  version 15 of flash player. using internet explorer version 11

    You'll probably need to add Facebook to compatibility mode:
    Fix site display problems with Compatibility View - Windows Help

  • Working with JSSE using multi-purpose keystore

    Hello,
    I am currently working on an application which employs the JCA for providing signatures, authenticating users etc., but also working with JSSE.
    More specifically: The application must be able to verify signatures on code packages created by known users and loaded at runtime; but for communication with other parts of the application, it shall use SSL connections.
    Now I worked through the JSSE manuals and I was able to set up a simple SSL application with client and server, using all the getDefaults() I could get a hold on.
    In the final application that I am working on, I will have a keystore with quite a lot of keys from users, public and possibly private ones, and also a key for the SSL communication. I have the strong feeling that I will not see many getDefault()s anymore.
    My problem is that by looking at the API, I don't have any clue how to tell the JSSE which key to use for the SSL connection from the keystore holding possibly many keys of users.
    Moreover, how do I pass the passphrase for unlocking the private key to the JSSE if it is not equal to the keystore password? (Which, by the way, seems to me to require passing via the command line - argh!)
    Help would be greatly appreciated.
    Michael

    I've got it.
    The secret is to create an own X509KeyManager. This key manager gets its keys from the keystore, so I have the chance to provide an alias which is intended to be used for SSL and to provide the key password.
    public class SpecialX509KeyManager implements X509KeyManager {
    public SpecialX509KeyManager(KeyStore keys, String sSSLAlias, String sPassword) {
    // browse the keystore,
    // get the key which has the given alias - and only this one -
    // and use the password to decrypt it
    // keep the key and its certificate chain
    The keystore must be loaded before, using the keystore password:
    KeyStore keys = KeyStore.getInstance("JKS");
    keys.load(new FileInputStream("server.ks"), "keystorepw".toCharArray());
    KeyManager[] akm = new KeyManager[1];
    akm[0] = new SpecialX509KeyManager(keys, "ssl", "ssl012");
    SSLContext sc = SSLContext.getInstance("TLS");
    sc.init(akm, null, null);
    SSLServerSocketFactory sslSrvFact = sc.getServerSocketFactory();
    That is, I have a keystore, using the password "keystorepw", containing keys with one using the alias "ssl" and the password "ssl012".
    Michael

  • Working with Guides using ActionScript in Photoshop

    I am facing some troubles when working with Guides in Photoshop (AS/Flash extension)
    Let's create guides showinglayer bounds:
                    var bounds:Array = activeDocument.activeLayer.bounds;
                    var guide_a:Guide = activeDocument.guides.add(Direction.VERTICAL, bounds[0]);
                    var guide_b:Guide = activeDocument.guides.add(Direction.HORIZONTAL, bounds[1]);
                    var guide_c:Guide = activeDocument.guides.add(Direction.VERTICAL, bounds[2]);
                    var guide_d:Guide = activeDocument.guides.add(Direction.HORIZONTAL, bounds[3]);
    This works fine. Layer bounds are marked correctly.
    If I try to remove individual guides, I am facing an issue:
                    guide_a.remove();
                    guide_b.remove();
                    guide_c.remove();
                    guide_d.remove();
    PS starts throwing strange errors:
    Error: General Photoshop error occurred. This functionality may not be available in this version of Photoshop.
    - The object "guide 8 of document 35" is not currently available.
    It is not clear, what document 35 really means (it is not name of actual document .. internal name?). Also interesting that remove() is not availabel in JavaScript API's.
    Also if I try to bind on "coordinate" property of Bound, no changes seems to be propagated.
    Any idea?
    Thanks,
    --Petr

    Yes it definitely looks like there is a problem with the reference returned by add(). Looks like you can work around it though by getting the guide by reference immediately after adding it using the known index.
    For your question about events. The easiest way to see if there is some event you can listen for is to use the ScriptListener in Photoshop. With that, you can quickly see whether or not an event fires when you expect (there may not be one available to scripting). Once you know the event fires, you can add the handler, using this as a reference: http://cssdk.host.adobe.com/sdk/1.0/docs/WebHelp/app_notes/photoshop.htm.
    I don't see a clear way to check the visibility of guides. Although there may be some magic you can do using descriptors. Maybe we'll get some help from a real Photoshop scripting expert
    Zak

  • Can the Cisco 7942 phones work with Broadsoft using SIP

    We have a few 7960 phones working with Broadsoft but we are having issues getting the 7942 phones to work. Is anyone using the 7942 with Broadsoft?       

    You can try and use the following guidelines but they natively are not supposed to support third party call control systems.
    http://www.asterisk-peru.com/node/2227
    http://www.888voip.com/configuring-cisco-7975-ip-phones-for-sip/

  • Different family class used for input  and output when working with sockets

    I have seen more or less everywhere the following code to open a socket and to receive input and send output through it:
    Socket server = new Socket("anyservername", 25):
    OutputStream out = server.getOutputStream();
    PrintWriter pout = new PrintWriter (out, true);
    pout.println("Hello");
    InputStream in = server.getInputStream();
    BufferedReader bin = new BufferedReader (new InputStreamReader(in));
    String response = bin.readLine();
    What I do not understand is:
    Why the BufferedReader needs InputStreamReader as an argument whereas printwriter does not want the OutputStreamReader as an argument but it is OK with just the OutPutStream?
    I would tend to believe that they should be more or less at the same level and use the same arguments?.
    In that sense if I use BufferWriter instead of PrintWriter I bet It should be OK the following code?:
    OutputStream out = server.getOutputStream();
    BufferedWriter bout = new BufferedWriter (out);
    String myOut = bout.writeLine();
    Cheers
    Umbi
    Edited by: Imbu on Jun 2, 2008 2:40 PM

    1. Does it even compile?
    2. While there is a fair amount of symmetry between reader and writer classes, don't assume it's exhaustive. Your best friend is the API:
    [http://java.sun.com/javase/6/docs/api/]
    3. Those were just examples. Code it the way you feel is best. I would specify charsets to make sure the encodings were platform independent. Networking and all that, don't you know...

  • How can i work with Mysql using socket

    hi
    When i connect through mysql using socket
    then can i send a query to mysql through socket.
    if yes then how
    retrive data which is performed by query
    plz help me
    THANKS

    not like its not possible, but you better refer to JDBC instead of plain socket... its much easier and its already been done...
    google for mysql jdbc tutorial or something...

  • Help working with sockets, please

    hi
    i've managed to do some applications similar to chat programs, and i would like to know if my design is... acceptable
    my problem used to be that any function trying to read data from a socket would block until it gets some data. if my applicacion is like a chat, i don't know when data is arriving.
    so my solution is:
    create a thread, which would be always reading the input stream from the socket. whenever it gets data, it send an event which listened by the main class, say, a JFrame.
    so i created my own events, listener and listenermulticaster. well it works great but i wonder if there is another simpler way to do it.
    another think that bothers me:
    when i have my thread with my connected socket, and i want to shut the appz down, the only way i've found is to close the socket. the thread must be able to manage that, and afterwards, returns from run function.
    well what do u think about all of this?? i would be very grateful for any opinion you tell me
    thanks in advance

    a reference to the thread, calls that method. the
    socket is closed, the main loop breaks (i dont
    remember now if an exception is thrown) and the thread
    ends
    i agree, i dont like this and it seems unreliable.
    about the method interrupt, what is the diference from
    retunrning from run method??
    thanks very much for your help!!you will have a method that is reading from the Socket, it will block until some data is available
    closing the Socket (one would hope) should cause that method to throw an Exception, you can use that Exception to exit the run() method, but if the Socket is closed from the other end, then it seems unreliable that the Exception is thrown, leavin the read method waiting for data that it can never recive
    Thread.interrupt() will terminate all such blocking IO methods and you can use this also to exit the run() method
    belt and braces maybe, but handy all the same

  • IOS 8 Safari not working with sites using Windows Authentication (again)

    A testbed of iPhones and iPads were updated to iOS 8 today. When trying to access intranet sites in our company that use Windows (IIS) Authentication, it challenges for the login and password 2 or 3 times, then nothing - just hangs.  These sites work fine on iOS 7 devices - and worked on the same devices that were upgraded.
    Windows Authentication was broken in iOS 7.0 also and not fixed until a later update. Why does this keep getting broken?

    This was a thread that discussed this when it was broken in iOS 7.0...
    https://discussions.apple.com/thread/5327078?start=0&tstart=0    
    I just tested with Chrome on the iPhone upgraded to iOS 8 and it works fine. It is Safari that is broken again.
    Of course, Apple won't give us a way to make Chrome the default browser when links are clicked in emails, so it's not exactly a solution.

  • Working with sockets with applets

    Hello, I am working in my account on a web server, and I am trying to develop a chat using applets. My program works great on the command line, but the applets cannot create a socket because of a SocketPermission problem. I have read about this problem a lot, and I found that applets will only create a socket with the server the applet originates from. I have still not had any success in allowing my applet to create a socket to connect to a server.
    I would appreciate any advice concerning this problem!
    Thanks so much!
    Christina

    If you are calling the HTML page containing the Applet as http://localhost then the Applet has to open a socket back to local host.
    Make sure you call the applet using the full ip address of the where the web server is running. This should match the socket ip address you are trying to open inside the Applet.

Maybe you are looking for

  • How do I change the "Open In" default from "Photoshop" to "Photoshop CC" in Bridge CC?

    When I double click on a photo in Bridge CC to open it in Photoshop CC for processing, I get an error message.  "Windows cannot find 'C:\program files\adobe\adobePhotoshop CS4 (64 bit)\Photoshop.exe."  Make sure you typed the name correctly, and then

  • How to identify responsive themes

    In Poojah's Best Practices for Responsive Projects, she warns against using responsive themes in non-responsive projects. The choice of themes seems to be identical for both responsive and non-responsive projects. How can I identify which themes are

  • Broken download link - ThinkPad 8 BIOS

    http://support.lenovo.com/us/en/products/tablets/t​hinkpad-tablet-series/thinkpad-8/downloads/DS10074​... The link to BIOS version 1.24 (GYUJ08WW) file gyuj08ww.exe is broken. There is a typo in the HTML link (href attribute), '8' character is missin

  • Why is Illustrator adding a slash to the beginning of all my exported artboard image file names?

    When ever I export my artboards as JPGs for my client to view Illustrator has recently started adding a slash to the front of the file name. For example, until a recent update my files would look like this when I exported them. As one would expect: a

  • Apple please rework the auto exposure adjustment

    90% of the time, the result is worse than before. It seems, Aperture's auto exposure adjustment is based on an average of the whole picture. So in its effort to get a well distributed histogram over the whole range, it happily blows the brighter part