Valhalla Legends Forums Archive | .NET Platform | Alternative for GetHostEntry()

AuthorMessageTime
Spilled[DW]
Since GetHostEntry() is version 2.0 and i have 1.0 what would be an alternative?

heres some code:

[code]
    Private Sub mnuConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuConnect.Click
        ConnectSocket("uswest.battle.net", 6112)
    End Sub

    Private Sub ConnectSocket(ByVal s As String, ByVal p As Integer)
        Dim hostEntry As IPHostEntry = Nothing

        hostEntry = Dns.GetHostByName(s)
        Dim address As IPAddress

        For Each address In hostEntry.AddressList
            Dim endPoint As New IPEndPoint(address, p)
            wSock = New Socket(endPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp)

        Next address
        If wSock.Connected Then
            MsgBox("HI!")
        End If
    End Sub
[/code]
As an alternative im trying GetHostByName(). Ideas?
June 27, 2006, 11:46 PM
Spilled[DW]
Problem Solved.

Edit:

Is it possible to use a NetworkStream or something similar with my socket? Since im not using a tcpClient just a regular Socket It doesnt have the GetStream() method. Ideas?
June 28, 2006, 12:06 AM

Search