Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

RUN TIME Error message '10049' when connecting to remote pc

sonu_amitsonu_amit Posts: 37Member
hi,
i have started making a chat machine for my organisation.
I have been facing problem. When I press Send Command Button I get a [red]RUN TIME Error message '10049'. Address is not available from the local machine.[/red]
How do i correct it?
[code]
All I have done is [blue]
1. Taken the Address of the Remote Machine
2. In the send command button
Winsock1.RemoteHost strRemoteIP,strRemotePort
Winsock1.SendData strMsg
[/blue]
[/code]


Comments

  • the walrusthe walrus Posts: 249Member
    [italic]RemoteHost[/italic] is a property. use [b]Connect[/b] to connect to a remote host (assuming you're using TCP). here's an example showing how to connect to a host and send a string:

    [code]
    Private Sub Form_Load()
    Dim strRemoteIP As String, lngRemotePort As Long

    strRemoteIP = "192.168.0.101" 'Make this the ip address of the machine you want to connect to
    lngRemotePort = 5190 'Whatever port the remote machine is listenning on

    Winsock1.Connect strRemoteIP, lngRemotePort
    End Sub

    Private Sub Winsock1_Connect()
    Winsock1.SendData "test string"
    End Sub
    [/code]

    you'll have to have another program set up to listen on this port and display the string. if you want to use UDP, use the [b]Bind[/b] method instead of [b]Connect[/b].
Sign In or Register to comment.