ASP.Net socket programming

Hi, I am trying to implement the MSN messenger protocol in
ASP.Net but can’t get any response from the server. It’s
returning an empty string. Can somebody point out what’s
wrong with the following code:


Imports System.Text

Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents Button1 As
System.Web.UI.WebControls.Button

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub 

InitializeComponent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, 

ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web
Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Protected WithEvents Button2 As 

System.Web.UI.WebControls.Button
Dim trialID As Integer
Dim networkStream As System.Net.Sockets.NetworkStream
Dim tcpClient As New System.Net.Sockets.TcpClient()

Private Sub Page_Load(ByVal sender As System.Object, 

ByVal e As System.EventArgs) Handles MyBase.Load
tcpClient.Connect(“64.4.13.58”, 1863)
trialID = 0
networkStream = tcpClient.GetStream()
End Sub

Private Sub Button1_Click(ByVal sender As 

System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
If networkStream.CanWrite Then
Dim sendBytes As Byte =
Encoding.ASCII.GetBytes(“VER 0 MSNP7 MSNP6 MSNP5 MSNP4
CVRO” & vbCrLf)
Response.Write(Encoding.ASCII.GetString
(sendBytes))
networkStream.Write(sendBytes, 0, 32)
End If
End Sub

Private Sub Button2_Click(ByVal sender As 

System.Object, ByVal e As System.EventArgs) Handles
Button2.Click
If networkStream.DataAvailable Then
Dim bytes(tcpClient.ReceiveBufferSize) As Byte
networkStream.Read(bytes, 0, CInt
(tcpClient.ReceiveBufferSize))

        Dim returndata As String = 

Encoding.ASCII.GetString(bytes)
Response.Write(returndata)
Else
If Not networkStream.CanRead Then
Response.Write(“You can not write data to
this stream”)
tcpClient.Close()

        End If
    End If
End Sub

End Class