Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.