![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
My question is, can I comunicate with a telnet server? I have a PPC application and i need to write and read string of text with a telnet server...
I'm trying to use Network.dll and BinaryStream.dll, but I don't have enough info and I don't know how to deal with these classes... Any suggestion or example will be very appreciate! ![]() Thanks! |
|
|||
|
Ok, that's what i did... and it connects properly...
My biggest problem was the dialogue with the tother computer after connecting.. That's what i did: Code:
Sub Connect(IP) 'ErrorLabel(errConnect) WaitCursor(true) TextBox2.Text = "Connecting to " & IP Dim client client.New1 client.Connect(IP,23) stream.New1(client.GetStream,true) TextBox2.Text = "Connection established." Return End Sub ![]() |
|
||||
|
You should remove the Dim client line.
Did you add a BinaryFile object named stream? See this example: You should add a Bitwise object named bit. Code:
Sub Globals
Dim buffer(0) As byte
End Sub
Sub App_Start
bit.New1
AddTimer("Timer1")
Timer1.Interval = 500
End Sub
Sub Connect(IP)
'ErrorLabel(errConnect)
WaitCursor(true)
TextBox2.Text = "Connecting to " & IP
client.New1
client.Connect(IP,23)
stream.New1(client.GetStream,true)
TextBox2.Text = "Connection established."
timer1.Enabled = true
WaitCursor(false)
End Sub
Sub Timer1_Tick
If client.DataAvailable Then
Dim buffer(4096) As byte
count = stream.ReadBytes(buffer(),4096)
TextBox2.Text = bit.BytesToString(buffer(),0,count)
End If
End Sub
|
|
|||
|
Hello Erel,
i don't wanna highjack this thread, but i've got a question regardings this. That piece never works for me: Code:
Sub Timer1_Tick
If client.DataAvailable Then Dim buffer(4096) As byte
count = stream.ReadBytes(buffer(),4096)
TextBox2.Text = bit.BytesToString(buffer(),0,count)
End If
End Sub
If client.DataAvailable Then .. end if gets never triggered and therefore i never catch the server's response.If i remove this check, i can read the server's response but run risk to get stuck because there's maybe no answer from the server pending anymore . cheers TWELVE |
|
||||
|
It's strange. DataAvailable should return the correct value.
See the ChitChat example which uses it. |
|
||||
|
I can confirm that DataAvailable should work. I've used it in two apps so far, on the device and desktop. If the Dim Buffer... line really is there maybe it's upsetting things even if it does get through the compiler. Dim should only go in Globals.
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| connectio tcpIP telnet protocol | mircome | Questions & Help Needed | 2 | 06-22-2008 11:16 AM |
| Read NMEA from Server | schimanski | Questions & Help Needed | 42 | 05-13-2008 08:42 AM |
| New server | Erel | Forum Discussion | 12 | 11-06-2007 04:21 PM |