Socket Receive problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



When I run this on my network at home and on my network at work it runs fine.
When this is run at a clients network I am receiving a [FIN, ACK] after the
first packet is received(There are 2 packets returned). I am not usre if t is
a problem with the code or with the clients network.

I am using the following Code:
public string DoSocketGet(string inputRequest)
{
// Create TcpClient
TcpClient client = new TcpClient(serverIP, serverPort);
// Translate the passed message into ASCII and store it as a Byte array.
Byte[] data = System.Text.Encoding.ASCII.GetBytes(inputRequest);
// Get a client stream for reading and writing.
// Stream stream = client.GetStream();
NetworkStream stream = client.GetStream();
// Send the message to the connected TcpServer.
stream.Write(data, 0, data.Length);
// Receive the TcpServer.response.
System.IO.StreamReader reader = new System.IO.StreamReader(stream);
System.Text.StringBuilder response= new StringBuilder();
while(reader.Peek() > 0)
{
response.Append((char)reader.Read());
}
reader.Close();
stream.Close();
client.Close();
return response.ToString();
}
.



Relevant Pages

  • Problem reading 2nd Packet on socket
    ... When I run this on my network at home and on my network at work it runs fine. ... When this is run at a clients network I am receiving a ... // Translate the passed message into ASCII and store it as a Byte array. ... // Get a client stream for reading and writing. ...
    (microsoft.public.dotnet.framework.remoting)
  • Socket problem
    ... When I run this on my network at home and on my network at work it runs fine. ... When this is run at a clients network I am receiving a ... // Translate the passed message into ASCII and store it as a Byte array. ... // Get a client stream for reading and writing. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Howto deploy McAfee Virusscan 7 updatesettings using gpo
    ... > I'm trying to install McAfee Virusscan enterprise 7 in my clients network. ...
    (microsoft.public.win2000.group_policy)