Announcement

Collapse
No announcement yet.

Bind to 127.0.0.1

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Nathan Evans
    replied
    Solved.

    Code:
             LOCAL ip AS LONG
             hSock = FREEFILE
             HOST ADDR "127.0.0.1" TO ip
             TCP OPEN SERVER ADDR ip PORT 400 AS hSock TIMEOUT 90
    I was unaware that HOST ADDR... had to output to a variable in such
    a way. I was calling it like: TCP OPEN SERVER HOST ADDR "127.0.0.1"....
    which wasn't working.

    Thanks.

    - Nath

    Leave a comment:


  • Lance Edmonds
    replied
    You should be able to use the HOST ADDR statement, of just convert it directly:

    HOST ADDR "127.0.0.1" TO ip&

    or use

    ip& = &H0100007F

    as derived by:
    01 = 1
    00 = 0
    00 = 0
    7F = 127

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Nathan Evans
    started a topic Bind to 127.0.0.1

    Bind to 127.0.0.1


    How do i bind a TCP server port to 127.0.0.1. I've been trying to use
    TCP OPEN SERVER ADDR, but it seems to want a Long, not a string.

    So which API do i use to convert the dotted-IP?

    Ta very much.

    - Nathan
Working...
X