Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

VB Socket to Java Socket

 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
  • 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..
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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..
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!