Ok im trying to get this winsoc code to work but it not working!! i converted the code from vb6 to .net and it dont work any help ?

vb6
VB Code:
  1. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Client
  2.  
  3.  WS.Close
  4.  WS.RemoteHost = txtIP.Text
  5.  WS.RemotePort = txtPort.Text
  6.  WS.Connect
  7.  Do Until WS.State <> sckConnecting
  8.   DoEvents: DoEvents: DoEvents: DoEvents
  9.  Loop
  10.  If WS.State = sckConnected Then
  11.   MsgBox "Connected to " & txtIP.Text & " on port " & txtPort.Text & "!"
  12.  Else
  13.   MsgBox "Could not establish a connection. Sorry."
  14.  End If
  15. end sub
  16.  
  17. Private Sub cmdSend_Click()
  18.  WS.SendData txtSend.Text
  19. End Sub
  20.  
  21.  
  22.  
  23. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''server
  24. Private Sub cmdBreak_Click()
  25.  WS.Close
  26. End Sub
  27.  
  28. Sub Log(Text As String)
  29.  txtReceived.Text = txtReceived.Text & vbNewLine & Text
  30.  txtReceived.SelStart = Len(txtReceived.Text)
  31. End Sub
  32.  
  33. Private Sub cmdListen_Click()
  34.  WS.LocalPort = txtPort.Text
  35.  WS.Listen
  36.  Log "[Listening on port " & txtPort.Text & "]"
  37. End Sub
  38.  
  39. Private Sub WS_Close()
  40.  Log "[Closed connection]"
  41. End Sub
  42.  
  43. Private Sub WS_ConnectionRequest(ByVal requestID As Long)
  44.  WS.Close
  45.  WS.Accept requestID
  46.  Log "[Connecting]"
  47.  Do Until WS.State <> sckConnecting
  48.   DoEvents: DoEvents: DoEvents: DoEvents:
  49.  Loop
  50.  Log "[Connected]"
  51. End Sub
  52.  
  53. Private Sub WS_DataArrival(ByVal bytesTotal As Long)
  54.  Dim Text As String
  55.  WS.GetData Text
  56.  Log "[Incoming Transmission]" & vbNewLine & Text
  57. End Sub
  58.  
  59. Private Sub WS_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
  60.  Log "[Error: " & Number & " - " & Description & "]"
  61. End Sub