Use Sockets/TCP in arduino + CC3000 for VB.NET/C#

Hi, I got here a part of the whole project's code from around the web. This is from the VB.NET part.

Imports System.Net.Sockets
Imports System.Text

Public Class Form1
    Dim tcpClient As New System.Net.Sockets.TcpClient()
    Dim networkStream As NetworkStream
    Dim KeyPressed As Integer

    Private Function Arduino_Connect(ByVal IP As String, ByVal Port As Integer) As Boolean
        tcpClient.Connect(IP, Port)
        networkStream = tcpClient.GetStream()
        If Not networkStream.CanWrite Or Not networkStream.CanRead Then
            tcpClient.Close()
            networkStream = Nothing
            Return False
        End If
        Return True
    End Function

    Private Sub Arduino_Write(ByVal Output As String)
        If Not IsNothing(networkStream) Then
            Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(Output)
            Dim endByte As [Byte]() = {&HFE}
            networkStream.Write(sendBytes, 0, sendBytes.Length)
            networkStream.Write(endByte, 0, 1)
        Else
            MsgBox("ERROR")
        End If
    End Sub

This project communicates with the Arduino+Wishield in real time, what I mean is, when the user press a certain key in a keyboard, the arduino responses IMMEDIATELY.

I have attached here the whole source codes of the said project.

I have been studying and searching and searching for the easiest way (just like this) in making the Arduino with CC3000 communicate with C#/vb.net. What I got right now is the CC3000 library made by Adafruit, it is complicated for me but I'm doing my best to study it.

Is there anything, any library that I can use for CC3000 to implement the method used in this sample project?
Also, the vb.net code that I've posted above, is it applicable also when I use the CC3000 library made by adafruit?

Please help. Thanks.

Project.zip (155 KB)

That appears to be setting up a simple telnet session between the PC and Arduino. The Arduino telnet server code should work, assuming it's compatible with your CC3000 .

Regards,
Ray L.

hey Ray, thank you so much for caring to reply. Yes, TELNET will be my very last bet.
Would you mind to see my telnet result here?

http://forum.arduino.cc/index.php?topic=295139.new#new

I'm having a problem there. a simple problem. CC3000 has a telnet support. :slight_smile: MY ONE AND LAST HOPE - telnet....@_@. Thanks

Glenn