F
fniles
I need to compress strings, then send it through socket.
After I compress it (I use GZipStream, but I can use other compression
component, too), how can I send it through socket ?
I am using socketwrench .NET Component, and it can send either string
or byte array.
Thank you.
Imports System.IO
Imports System.IO.Compression
Dim sPacket As String
Dim buffer() As Byte
Dim totalCount As Integer
Dim mem As New IO.MemoryStream
Dim gz As New System.IO.Compression.GZipStream(mem,
IO.Compression.CompressionMode.Compress, True)
Dim encoding As New System.Text.UTF8Encoding()
buffer = encoding.GetBytes(sPacket)
gz.Write(buffer, 0, buffer.Length)
gz.Close()
Socket.Write(...) --> How can I send the compressed string or byte
array to Socket ?
After I compress it (I use GZipStream, but I can use other compression
component, too), how can I send it through socket ?
I am using socketwrench .NET Component, and it can send either string
or byte array.
Thank you.
Imports System.IO
Imports System.IO.Compression
Dim sPacket As String
Dim buffer() As Byte
Dim totalCount As Integer
Dim mem As New IO.MemoryStream
Dim gz As New System.IO.Compression.GZipStream(mem,
IO.Compression.CompressionMode.Compress, True)
Dim encoding As New System.Text.UTF8Encoding()
buffer = encoding.GetBytes(sPacket)
gz.Write(buffer, 0, buffer.Length)
gz.Close()
Socket.Write(...) --> How can I send the compressed string or byte
array to Socket ?