Login  
Search All Forums
Dart Home | PowerTCP Sockets for .NET | Custom Development Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums   
AuthorForum: PowerTCP Sockets for .NET (Secure and Standard)
Topic: Questions about sending byte data with sockets.net
frodo_x

From: unknown, Greece
Posts: 8
Member Since: 06/10/01
posted July 22, 2004 12:22 PM

Hello,
   I have a little problem transferring an
image using sockets.net.I guess the problem is
cause i am new to vb.net and dartsockets.
So any help is appreciated! :-)
thanks in advance


Client:

 Dim path As String = "c:\a.jpg"
    Dim fs As FileStream
    fs = File.Open(path, FileMode.Open)
    Dim b(fs.Length - 1) As Byte
    fs.Read(b, 0, b.Length)
    tcp1.Send(b)

I guess its ok until now.i have no way to
confirm this.

Server:
...
Do While (e.Tcp.Connected)
...
Dim s As String = e.Tcp.Stream.Read(vbBack, 10000000, found)
....
Case else
'using a richtextbox i can see the data comming
at this point.looks garbage.

My question is:i've send a byte array from the
client.and now i have a string at the server.
What do i do to write it in a jpg file at the
server side?How do i load them in a byte array?
can this byte->string conversion lose data?
I am confused cause the data don't
come all at once,i've counted 618 "case else"
called for a file 187 Kbytes.is this normal?
I thought it will all go at once since increased
the bufer to 10000000?

oh and another question.
can i say...
dim b(1024) as byte
tcp1.send("send" + b + vbcrlf)
?
do i have to do it in separate sends?

Thank you again for your answer.

Angel
frodo_x

From: unknown, Greece
Posts: 8
Member Since: 06/10/01
posted July 23, 2004 9:37 AM

Just forget it.stupid questions :-)
i have found everything i need.
btw,your components rock ;-)
Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX