A
Andrew Jackson
I am writing a newsgroup client. I have the protocol figured out. But I
get slow transfer speeds off any of the network objects read the data from
For example one of the commands for a news client to use is "XOVER
articlenumber-"
This return string after string of all the news articles from article number
on....
Another newsclient, i wont name names, pulls data down just fine. Using a
"newsgroup header" accelerator that compresses the headers server side and
transmits then then uncompresses them and delivers them to the client I can
see exactly how much data is being download. They give the stats of data
transfer speed. This other program routinely gets speeds of greater than
1Mbps. It spikes up to 2Mbps and occassionally goes down to 0.5Mbps. When
I open a connection and issue the proper command to do the same I can see
via the accelerator that my data read speeds will rarely go over 0.5Mbps
and will actually however from 0.1 to 0.5Mbps for the life of the transfer.
I have tried many different ways. Using the NetworkStream and a
StreamReader object reading line by line off the stream. Reading bytes off
the Network Stream object, brought off the TCPClient object. Working
directly with the Socket object and not the TCPClient object. I have taken
out any and all extra processing that could be done off the received bytes
just to eliminate string comparisons etc off as a cause of the performance
problem.
I have tried it in VB.Net ... C# ... unmanaged C++ code all return the same
pitiful network transfer rates.
Following is a snippit of code I am using on the VB side to read data off
the stream.
Dim buffer(8000) As Byte
Dim se As SocketError
Dim iRx As Integer
Do While True
iRx = m_Socket.Receive(buffer, 0, buffer.Length, se)
Loop
I know this is an endless loop at this point but for my testing purposes
this is fine. There is plenty of data for me to get in the 50 million worth
of lines that this XOVER command is returning to me.
Here is some of the code from the class I am using to create the object.
Private m_Socket As New
System.Net.Sockets.Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp)
Private m_strHost As String
Private m_intPort As Integer
Property Host() As String
Get
Return m_strHost
End Get
Set(ByVal value As String)
m_strHost = value
End Set
End Property
Property Port() As Integer
Get
Return m_intPort
End Get
Set(ByVal value As Integer)
m_intPort = value
End Set
End Property
Public Function Connect() As Boolean
Dim ipAdd As IPAddress = Dns.GetHostEntry(m_strHost).AddressList(0)
Dim remoteEP As IPEndPoint = New IPEndPoint(ipAdd, m_intPort)
m_Socket.Connect(remoteEP)
Return True
End Function
I know I have no error handling in yet but am merely at the testing phase.
I do not know why at this point I have such pitiful transfer rates. I hope
someone can give me some type of idea. I can also share some of the other
methods I tried to use to read the data off the various different connection
methods I have tried. I am about to try with another language... it starts
with a j..... even though I really dont have any desire to use it Please
help
Thanks
get slow transfer speeds off any of the network objects read the data from
For example one of the commands for a news client to use is "XOVER
articlenumber-"
This return string after string of all the news articles from article number
on....
Another newsclient, i wont name names, pulls data down just fine. Using a
"newsgroup header" accelerator that compresses the headers server side and
transmits then then uncompresses them and delivers them to the client I can
see exactly how much data is being download. They give the stats of data
transfer speed. This other program routinely gets speeds of greater than
1Mbps. It spikes up to 2Mbps and occassionally goes down to 0.5Mbps. When
I open a connection and issue the proper command to do the same I can see
via the accelerator that my data read speeds will rarely go over 0.5Mbps
and will actually however from 0.1 to 0.5Mbps for the life of the transfer.
I have tried many different ways. Using the NetworkStream and a
StreamReader object reading line by line off the stream. Reading bytes off
the Network Stream object, brought off the TCPClient object. Working
directly with the Socket object and not the TCPClient object. I have taken
out any and all extra processing that could be done off the received bytes
just to eliminate string comparisons etc off as a cause of the performance
problem.
I have tried it in VB.Net ... C# ... unmanaged C++ code all return the same
pitiful network transfer rates.
Following is a snippit of code I am using on the VB side to read data off
the stream.
Dim buffer(8000) As Byte
Dim se As SocketError
Dim iRx As Integer
Do While True
iRx = m_Socket.Receive(buffer, 0, buffer.Length, se)
Loop
I know this is an endless loop at this point but for my testing purposes
this is fine. There is plenty of data for me to get in the 50 million worth
of lines that this XOVER command is returning to me.
Here is some of the code from the class I am using to create the object.
Private m_Socket As New
System.Net.Sockets.Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp)
Private m_strHost As String
Private m_intPort As Integer
Property Host() As String
Get
Return m_strHost
End Get
Set(ByVal value As String)
m_strHost = value
End Set
End Property
Property Port() As Integer
Get
Return m_intPort
End Get
Set(ByVal value As Integer)
m_intPort = value
End Set
End Property
Public Function Connect() As Boolean
Dim ipAdd As IPAddress = Dns.GetHostEntry(m_strHost).AddressList(0)
Dim remoteEP As IPEndPoint = New IPEndPoint(ipAdd, m_intPort)
m_Socket.Connect(remoteEP)
Return True
End Function
I know I have no error handling in yet but am merely at the testing phase.
I do not know why at this point I have such pitiful transfer rates. I hope
someone can give me some type of idea. I can also share some of the other
methods I tried to use to read the data off the various different connection
methods I have tried. I am about to try with another language... it starts
with a j..... even though I really dont have any desire to use it Please
help
Thanks