Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TCP/IP invalid handle error. What can I do?
#1
Hi friends,
please help me to find where I have coded the bug...

Code: (Select All)

$Unstable:Http

Screen _NewImage(512, 512, 256)

Dim a(511, 511) As Integer 'an array we'll send

x = _OpenClient("TCP/IP:1234:localhost") 'try to connect to a host

If x = 0 Then 'couldn't be client, so become a host
    'put some data into array a
    For xx = 0 To 511
        For yy = 0 To 511
            a(xx, yy) = xx * yy
        Next
    Next
    Print "(Try passing data via TCP/IP!)"
    Print "Waiting... (Press any key to end)"
    x = _OpenHost("TCP/IP:1234")
    If x = 0 Then Print "failure to create host" Else Print "Host ON"
End If


x = _OpenClient("TCP/IP:1234") 'try to connect to a host
Print x
If x < 0 Then
    z = _OpenConnection(x)
    Print "z"; z
    'connect to host as a client



    If z < 0 Then
        Print "Connected to host. Reading data..."
        Do
            Put #z, , a() 'send array a to any client that connects
            Close z
            Print "Array data send to client!"


            Get #x, , a()
            _Limit 100
        Loop Until EOF(x) = 0 'wait until enough data to fill the array arrives
        For xx = 0 To 511
            For yy = 0 To 511
                PSet (xx, yy), a(xx, yy)
            Next
        Next
        Close x
        Print "That's how you share data folks!" 'G@lleon
        Do: Loop Until InKey$ = ""
    Else
        Print "Failure connection with z "; z
    End If
    _Limit 10

    Print "Finished!"
    End

Else
    Print "Failure to create host client connection "; x
End If

End

I get always the message of error "invalid Handle" on line ... (that of _OPENCONNECTION instruction) but I am not able to understand why.
Thanks for time spent for helping me
Reply


Messages In This Thread
TCP/IP invalid handle error. What can I do? - by TempodiBasic - 09-20-2024, 10:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Mac debugger not connecting, a user error! BlameTroi 0 110 02-07-2026, 06:18 PM
Last Post: BlameTroi
  ERROR MESSAGES COLORS ? aurel 5 399 01-02-2026, 11:26 AM
Last Post: aurel
  Using CONST & _RGB used together seem to error... Dav 12 714 12-12-2025, 12:29 AM
Last Post: Dav
  error doing image collision detection with _MemGet madscijr 55 4,765 10-01-2025, 03:25 PM
Last Post: bplus
  error on function returning _mem Herve 5 698 07-05-2025, 08:06 PM
Last Post: hsiangch_ong

Forum Jump:


Users browsing this thread: 1 Guest(s)