Have a Question?
Print

00848: Establishing Socket Connections

Title:

Establishing Socket Connections

Description:

Step by step instructions to get sockets communicating in (V)PRO/5. This goes along with the examples in the Socket Overview documentation, but includes a few more specifics.

  1. Add the following alias line to the config.bbx file, it it does not already exist.
            alias N0 tcp “” nodelay
  2. Open one session of VPRO5. 
  3. Start a server session.
            >open (2,MODE=”port=12000″)”N0″
  4. From a DOS prompt, type:
            c:\> netstat -a |more
            (This will show the server started on port 12000 and it should say it’s “listening”.) 
  5. Open a second session of VPRO/5.
  6. Start a client session.
            >open (1,MODE=”host=localhost,port=12000″)”N0″ 
  7. From client session:
            >write(1) “socket test”
            > 
  8. From server session:
            >read (2)a$
            >?a$
            socket test (value of a$)
            >
  9. From Client session:
            >input “enter something: “,i$
            enter something: another socket test
            >let i$=i$+$0D0A$;write record(1)i$
            >
  10. From Server session:
            >read(2)a$
            >print a$
            another socket test
Table of Contents
Scroll to Top