• 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

VB Socket to Java Socket

 
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Guys,

Good Day..

I have this trivial question to ask, we are developing programs that interacts with machines.
According to the vendor, machine is opening server socket that we can poll to ask for machine parameters. The socket is a VB(Visual Basic) socket.

My question is, is it possible for me to develop a client socket written in java that could communicate with the VB socket? Since I know what port is opened on the machine, I was thinking if I could create a client socket that listens to that port also.

I am familiar with creating a VB client socket, but I want to explore the possibility of doing it, the java way.

Thanks..
 
Marshal
Posts: 28263
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure it is. It doesn't matter what language the server is written in, all you need to know is the protocol that the server implements and you can connect to it from Java code.
 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,

Thanks for your reply.

all you need to know is the protocol that the server implements



Just want to ask, by protocol, do you mean how the machine serversocket is sending the messages to the client listening to its port and how to particularly parse or interpret the message.

Thanks again.. my question isn't trivial anymore..
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, that's meant by protocol. It doesn't sound as if the server could use a pre-existing protocol for which you can look up the spec at the IETF, so you'll need to get a description from the folks who run the server.

One thing to keep in mind is that Windows and Java use a different kind of byte ordering (little-endian vs. big-endian), so you may need to swap the bytes of any 2-byte or 4-byte data types you send and receive.
 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf,

Thanks for your confirmation.

One thing to keep in mind is that Windows and Java use a different kind of byte ordering (little-endian vs. big-endian), so you may need to swap the bytes of any 2-byte or 4-byte data types you send and receive.



I dont know this yet for now. But I will ask javaranch again when I encounter some problem. You bet.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic