I will check it out... in the mean time I wrote some code that more closely
matches the code I wrote for java... It also runs slow as molasses. I have
tried to try to do these things in different ways. But like I said even
doing it with c++ I still get the same slow transfers.
Imports System.Net.Sockets
Imports System.IO
Module Module1
Dim socket As Socket = New
System.Net.Sockets.Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp)
Dim ns As NetworkStream
Dim sr As StreamReader
Dim sw As StreamWriter
Sub Main()
socket.Connect("localhost", 119)
ns = New NetworkStream(socket)
sr = New StreamReader(ns)
sw = New StreamWriter(ns)
ReadLine()
SendLine("AUTHINFO USER myusername")
ReadLine()
SendLine("AUTHINFO PASS mypassword")
ReadLine()
SendLine("GROUP alt.binaries.multimedia")
Dim strReturn As String = ReadLine()
Dim artCount As String = strReturn.Split(" ")(1)
Dim artFirst As String = strReturn.Split(" ")(2)
Dim artLast As String = strReturn.Split(" ")(3)
SendLine("XOVER " & artFirst & "-")
While True
ReadLine()
End While
End Sub
Public Sub SendLine(ByVal Text As String)
sw.Write(Text & vbCrLf)
sw.Flush()
End Sub
Public Function ReadLine() As String
Dim strLine As String
strLine = sr.ReadLine
Return strLine
End Function
End Module
The java code I wrote is the following:
import java.util.Scanner;
import java.io.*;
import java.net.*;
/**
* The HelloWorldApp class implements an application that
* simply prints "Hello World!" to standard output.
*/
class MySocket {
static Socket socket;
static PrintWriter out = null;
static BufferedReader in = null;
public static void main(String[] args) throws Exception
{
socket = new Socket("localhost", 119);
out = new PrintWriter(socket.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
ReadLine();
SendLine("AUTHINFO USER myusername");
ReadLine();
SendLine("AUTHINFO PASS mypassword");
ReadLine();
SendLine("GROUP alt.binaries.multimedia");
String ret = ReadLine();
String artCount = ret.split(" ")[1];
String artFirst = ret.split(" ")[2];
String artLast = ret.split(" ")[3];
System.out.println(artCount);
System.out.println(artFirst);
System.out.println(artLast);
SendLine("XOVER " + artFirst + "-");
boolean flag=true;
while (flag) {
ReadLine();
}
}
public static void SendLine(String text) throws Exception
{
out.println(text);
}
public static String ReadLine() throws Exception
{
String line;
line = in.readLine();
return line;
}
}
[quoted text, click to view] "Jack Jackson" <jacknospam@pebbleridge.com> wrote in message
news:it80g3dpg2i9t99i2dsp842ubi83o4lrgc@4ax.com...
> On Sun, 30 Sep 2007 14:17:57 -0400, "Andrew Jackson" <no email
> specified> wrote:
>
>>
>>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
>
> Do you not have Option Strict set to On?
>
> It looks to me like in VS2005 there is no overload of Socket.Receive
> with the paramters you are specifying, and that the fourth argument
> will be assumed to be a SocketFlags, not a SocketError.
>
> I have no idea what effect if any that might have.