• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error connecting to server running on VB!

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a java program that opens a new socket connection to the server (where VB application is listening) and then sends some data. The VB application is supposed to receive it and then send some other data back to the java client, which is now reading input stream. However, everytime I try to read from input stream it returns me -1 . Can anyone suggest anything please? Following is my code. fyi: Its part of client migration from VB to Java (server is still VB). The VB client works perfectly for the same using winsock but java doesnt

outStr.write(vgBufferOut); //write bytes array to output stream

socket.shutdownOutput();

inStr = socket.getInputStream(); //get input stream

vlLenbufferIn = inStr.read(vlBufferIn); //read

System.out.println("Length is " + vlLenbufferIn); //this always returns -1 - end of stream
 
reply
    Bookmark Topic Watch Topic
  • New Topic