Can Java Socket listen from VB?

I have a program that first writes some data on output stream on socket , on which VB program is listening..and then it try to read from input stream what VB program would write back. Everytime I write the data , it doesnt throw any exception at that point and when I do inStream.read() , it returns -1 indicating end of stream. However, when I run a VB client using WinSock , it works perfect!!! I thought it should not matter whether client is java or VB ..but was wondering if any of you have any opinion on this? My java client just doesnt seem to work. Both are communicating through TCP protocol.
fyi: following is the piece of code..
    outStr = socket.getOutputStream(); // connected
    outStr.write(vgBufferOut); //vgBufferOut is bytes array.
    socket.shutdownOutput(); //if I dont shutdown output stream server will stay in the loop
    inStr = socket.getInputStream(); //get the input stream
     vlLenbufferIn = inStr.read(vlBufferIn);  //store it in byte array vlBufferIn and get length.
      System.out.println("Length is " + vlLenbufferIn);   //This always returns -1

I believe it should work. Did you try it with a java server on the other side? If you are completely stuck try using a TCP monitor to monitor all data that is transmitted. I recommend the one provided with Apache Axis:
http://docs.pushtotest.com/axisdocs/user-guide.html#tcpmon
but I am sure you can find others too.

Similar Messages

  • Can't start listener from OEM. It appears as Stopped although it is not.

    Hi,
    I can't make the EM show the listener as running, it always shows it as stopped. I checked it with lsnrctl and it is running, but in EM appears as stopped. I refreshed the screen and nothing; I tried to start it from the EM, and it displays a message like "The listener has been correctly started", but when I check the status in EM it is still stopped. And when I check the details, it shows an error "Access denied", NET_ADMIN_ERROR,REMOTE_OP_ERROR,No such file or directory. I think I have the right credentials (I'm in the administrators group, and I have log on as batch job)
    I would appreciate any help on this.
    Thanks a lot
    Ricardo

    Hi Nicolas- here's the SQLNet and listener file:
    -----------------LISTENER
    # listener.ora Network Configuration File: C:\oracle\product\10.1.0\Db_1\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    LISTENER2 =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    jon =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    -----------------SQLNET
    # sqlnet.ora Network Configuration File: C:\oracle\product\10.1.0\Db_1\network\admin\sqlnet.ora
    # Generated by Oracle configuration tools.
    #SQLNET.AUTHENTICATION_SERVICES= (NTS)
    #NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
    I can't see any excess protocols in the listener. As per some metalink entries - I've commented out the "SQLNET.AUTHENTICATION_SERVICES= (NTS)" line from the SQLNet file.
    Still the same problem.
    To be honest - all replies to postings for this error have not worked. I've contacted some guys with the same problem - and their resolution was to completely reinstall XP and then Oracle again. Just removing and reinstall Oracle was insufficient. So - i guess i'm going to have to follow suit.
    Any last minute suggestions before this bit of drastic action?!

  • Stop and then start Listener from OEM

    Hi,
    I am new to Oracle. I notice after stopping listener using OEM on Windows XP, the TNSLNR.exe is terminated as I expected. At that point, all connections include OEM, iSQL*PLUS and SQL*PLUS should close connection.
    If this is right, how can one start listener from OEM? One needs listener work before using OEM to config something else. What is the purpose of Start button for listener on OEM? Even more perplexing me is that iSQL*PLUS is still works! Does iSQL*PLUS not use listener for connection?
    Your help will be appreciated,
    -Hong

    Hi
    i think its not possible to start the listener from oem, because the oem use the listener to communicate to the db.
    Regards
    Mirko

  • Edit listener from ASM instance in OEM

    Hi
    I've installed Oracle Grid Infrastructure for a standalone server, and next installed database 11g. I have ASM and orcl instances. Under ASM (in ORACLE_HOME/grid) I have listener (listener.ora file), and under orcl instance I have only tnsnames.ora (so I can connect by local naming). In OEM Database Control, in Net Services Administration I see only local names, but not listeners. So, can I edit listener from ASM instance in OEM Database Control?
    Thanks awfully for help.
    Regards

    Yes, you can use the Net Manager also to do the same but it should be started from the Grid Home and not from the Oracle Home.
    HTH
    Aman....

  • How can I create a java.awt.Image from ...

    Hi all,
    How can I create a java.awt.Image from a drawing on a JPanel?
    Thanks.

    JPanel p;
    BufferedImage image =
        new BufferedImage(p.getWidth(), p.getHeight, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = image.createGraphics();
    p.paint(g);
    g.dispose();

  • I can no longer download any NPR podcasts I subscribe to. I can download and listen to other podcasts but none from NPR.  I have tried on Windows 7 and Windows 8.  Other podcasts, music etc. download fine.

    I can no longer download any NPR podcasts I subscribe to.
    I can download and listen to other podcasts but none from NPR. 
    I have tried downloading the podcasts on computers that run Windows 7 and Windows 8.  Other podcasts, music etc. download fine.
    iTunes version:  11.3.0.54
    I have tried uninstalling, reinstalling iTunes and I have tried unsubscribing and resubscribing to the podcasts.
    I don't have trouble getting NPR podcasts from the store. I just can't play them in iTunes.

    For additional context and to verify if we are talking about the same behavior.  Here is what the download screen looks like on my iPod:

  • Java.sql.SQLException: can't create statement from closed connection

    java.sql.SQLException: can't create statement from closed connection.
    at com.caucho.sql.QPooledConnectionImpl.prepareStatement(QPooledConnecti onImpl.java:411)
    I am getting this error with my JSP's, i am running on Resin on Win2k, and MySql as backend.
    Has anyone else also faced this issue ?
    Looking for someone to help me to solve this issue.
    rc

    Looking for someone to help me to solve this issue.Maybe you are closing the connections. You might want to verify that you are not doing that. Or if you are that that is the correct way to return the connection to the pool.
    Or you could have stale connections. Some databases will time out connections if the connection is no used in a while. (This is a good thing.) But this means connection pools must do something with connections that are not used for a while. The pools usually have a configuration option(s) which allows you to set up a keep alive message which keeps the database from closing the connection.

  • Can we call a Java Stored Proc from a PL/SQL stored Proc?

    Hello!
    Do you know how to call a Java Stored Proc from a PL/SQL stored Proc? is it possible? Could you give me an exemple?
    If yes, in that java stored proc, can we do a call to an EJB running in a remote iAS ?
    Thank you!

    For the java stored proc called from pl/sql, the example above that uses dynamic sql should word :
    CREATE OR REPLACE PACKAGE MyPackage AS
    TYPE Ref_Cursor_t IS REF CURSOR;
    FUNCTION get_good_ids RETURN VARCHAR2 ;
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t;
    END MyPackage;
    CREATE OR REPLACE PACKAGE BODY MyPackage AS
    FUNCTION get_good_ids RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'MyServer.getGoodIds() return java.lang.String';
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t
    IS table_cursor Ref_Cursor_t;
    good_ids VARCHAR2(100);
    BEGIN
    good_ids := get_good_ids();
    OPEN table_cursor FOR 'SELECT id, name FROM TableA WHERE id IN ( ' | | good_ids | | ')';
    RETURN table_cursor;
    END;
    END MyPackage;
    public class MyServer{
    public static String getGoodIds() throws SQLException {
    return "1, 3, 6 ";
    null

  • Is there an app i can use to listen or record conversations from i5s to i6plus ?

    is there an app i can use to listen or record txts and conversations from i6plus to i5s ?

    Maybe you should ask Apple.
    This forum is just users like yourself who can do absolutely nothing to change the way the iPhone works.
    Allan

  • I have a 2013 Dodge with a RHR radio system. I have paired my daughter's iPod to the system. However, when she wants to listen to it in the backseat via the VES it says that no device is available. Can you not listen to a paired device from the rear VES?

    I have a 2013 Dodge with an RHR radio. I have paired my daughter's iPod touch to the system. When she wants to listen to it from the rear VES, it says that there is no device available even when it show connection on the iPod and on the front screen. Can you not listen to a paired device on the rear VES?

    Mullaly75 wrote:
    I assume u guys don't understand what open source software is
    Yes, I think most of us do understand what open source software is. It sounds as if you don't. Here's some information:
    Open-source software (OSS) is computer software that is available in source code form: the source code and certain other rights normally reserved forcopyright holders are provided under an open-source license that permits users to study, change, improve and at times also to distribute the software.
    Open source software is very often developed in a public, collaborative manner. Open-source software is the most prominent example of open-sourcedevelopment and often compared to (technically defined) user-generated content or (legally defined) open content movements.
    from http://en.wikipedia.org/wiki/Open_source_software
    Yes, Tom Wu of Stanford wrote a paper on something called Secure Remote Access Protocol. It's a form of Asymetric Key Exchange and has nothing to do with hacking anything. It's actually intended to protect data.

  • How can i return object from oracle in my java code using pl/sql procedure?

    How can i return object from oracle in my java code using pl/sql procedure?
    And How can i returned varios rows fron a pl/sql store procedure
    please send me a example....
    Thank you
    null

    yes, i do
    But i can't run this examples...
    my problem is that i want recive a object from a PL/SQL
    //procedure callObject(miObj out MyObject)
    in my java code
    public static EmployeeObj callObject(Connection lv_con,
    String pv_idEmp)
    EmployeeObj ret = new EmployeeObj();
    try
    CallableStatement cstmt =
    lv_con.prepareCall("{call admin.callObject(?)}");
    cstmt.registerOutParameter(1, OracleTypes.STRUCT); // line ocurr wrong
    //registerOutParameter(int parameterIndex, int sqlType,String sql_name)
    cstmt.execute();
    ret = (EmployeeObj) cstmt.getObject(1);
    }//try
    catch (SQLException ex)
    System.out.println("error SQL");
    System.out.println ("\n*** SQLException caught ***\n");
    while (ex != null)
    System.out.println ("SQLState: " + ex.getSQLState ());
    System.out.println ("Message: " + ex.getMessage ());
    System.out.println ("Vendor: " + ex.getErrorCode ());
    ex = ex.getNextException ();
    System.out.println ("");
    catch (java.lang.Exception ex)
    System.out.println("error Lenguaje");
    return ret;
    Do you have any idea?

  • Can I load batteries from an electrical socket, using the same as my IPhone charger?

    Can I load batteries from an electrical socket, using the same as my IPhone charger?

    Your terminology is confusing...  If you are describing the USB power adapter (that plugs into a wall outlet) that you use to charge your iPhone, you can use the same connection to charge your iPod nano.

  • HT3382 why i can't listen from my tv when i connect my macbook air by airport/hdmi cable?

    why i can't listen from my tv when i connect my macbook air by airport/hdmi cable?
    but just when i try to open any website. itunes work normal

    Hi
    Does your Macbook support Airplay?    What year is it?  Typically mid 2011 and newer Macbooks offer Airplay capability.
    Cheers

  • Can we Return values from Java Bean to Form

    Hi All,
    I have a Bean area defined on a Form. The Bean Area consists of a Text field which gets populated by path of a file selected using Browse button.
    Can I return this path as a parameter from the Java Bean to the form? Is there any function for this?
    Regards,
    Prathima.

    If you designed your bean to offer the ability to exact info/data from it, then yes you can get a value from the bean into the form (pl/sql) - using Get_Custom_Property
    Refer to the following which is a good example of how to build a bean. Specifically look at page 12 where is shows how to use Get_Custom_Property.
    This is NOT an Oracle supported or provided document or web site, but it is a very good example.
    http://forms.pjc.bean.over-blog.com/ext/http://sheikyerbouti.developpez.com/forms-pjc-bean/first-bean/first_bean.pdf

  • Can "netca" delete and remove a listener from a cluster from cmd line?

    We are trying to automate the shutdown, deletion and removal of a clustered listener. To date all we have been able to do is to remove it with "netca" interactively.
    Does anyone know if "netca" can use a response file or some other method to programatically remove a listener and remove it from the cluster?

    oes anyone know if "netca" can use a response file or some other method to programatically remove a listener and remove it from the cluster? I am not sure, but this is the way we followed to un-register the Listener from the cluster, and create a new one!
    1) Ensure Nodeapps is stopped on all Nodes
    2) Use the crs_unregister to remove all Listener Entries =
    crs_unregister ora.acmord1p.LISTENER_DBPROD_ORD1P.lsnr
    crs_unregister ora.acmord2p.LISTENER_DBPROD_ORD2P.lsnr
    The below command should not reflect any entry for Listener after "crs_unregister"
    command. ==
    $ srvctl config listener -n aXXXXXX2p
    $ srvctl config listener -n aXXXXXX1p
    $ crs_stat -v
    3) Once the Listener entries are removed, invoke NETCA to configure the Listeners
    4) Start the Nodeapps on all Nodes
    Check the new Listener status.
    $ srvctl config listener -n aXXXXX2p
    $ srvctl config listener -n aXXXXX1p
    $ crs_stat -v << This should show LISTENER ONLINE >>

Maybe you are looking for

  • Is it a bug in JUCtrlListBinding.java

    Hi, I came across the following method in JUCtrlListBinding.java.    protected Object findAndUpdateSelectedIndex(Object val, boolean flag)       int selIndex = findListIndex(val);       Object matchVal = null;       if (selIndex >= 0)          //this

  • Measuring Digital Output from 3 Hall Effect Sensors

    I'm working on a project where I need to map the digital signal coming from 3 hall effect sensors, plugged into the first three channels of a NI 9402 installed in a NI cDAQ-9172 chassis (slot 5).  I've done plenty of analog signal measurements before

  • How to set print area in Pages

    I've created a document in Pages and when I view it there are two pages.  I want to send it to people as an attachment and I only want them to see the first page.  I've tried to delete it, checked the margins they are OK, and looked to see if there i

  • ROWNUM in UNION operator

    All, I have a requirement in SQL that I have to number each row. Hence I thought of using ROWNUM. But the sql query I'm using uses UNION operator. Hence I used like this select a,b,rownum as 'field1' from table1 union select c,d,1 as 'field1' from ta

  • Universe connections

    Several months ago ATT installed Uverse on my HP PC Pavilion p7-1227c. ( Microsoft 8.1 ) I was't aware until later the tech. did not include my Dell PC Diminision series 2400 (Microsoft XP ) I get a signal form my Dell XP that it was shut down to avo