Results 1 to 3 of 3

Thread: java, vb, and winsock

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870

    java, vb, and winsock

    hi,

    I have to write a program in java and a program in VB that can communicate together. I know how to use winsock in VB but can it be used in java.
    If the answer is yes, does anybody have any code. The VB will be the server(listen) and the Java program will be the one connecting.


    Thanks for any help
    Nick

  2. #2
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    No the winsock control is activeX and that is microsoft. You need to use the socket class that comes with java.

    The good news is that they are just that sockets and winsock and java can communicate no problems, but you will have to learn about them in java.

  3. #3
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    Socket documentation (along with all other important Java API information) can be found at:
    http://java.sun.com/j2se/1.3/docs/api/index.html
    Scroll down on the left navigation bar (where it says "All Classes") until you get to Socket. You'll also need to look at SocketImpl here as well.

    It says that you can use the following constructor:
    Socket(InetAddress address, int port)

    Don't forget to declare this at the top:
    import java.net.Socket;

    It also says that to actually make a connection, you'll need to use the SocketImpl class (so specify import java.net.SocketImpl; at the top also)

    This should get you in the right ballpark.

    cudabean

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width