Y
Yechezkal Gutfreund
I am running VS2003. I have a C# console project that is accepting
socket connections. I have a C# console client that can connect to it (TCP,
port 1613).
However, when move the same code to a Compact Framework project (the client
that is, of course).
and try to use the emulator to connect to the accepting program, I get a
message about
the server actively rejecting the connection.
All IP addresses are hard coded:
public class StationMaster
{
string OrchHost = "192.168.1.50";
int OrchPort = 1613;
TcpClient OrchSock;
private NetworkStream OrchStream;
private StreamReader OrchRead;
private StreamWriter OrchWrite;
private AsyncCallback OrchCallback;
private byte[] IOBuffer;
private int IOBufferSize = 4096;
string PacketFile = "Packet.xml";
XmlDocument Xdoc = new XmlDocument();
StationMasterGUI TheGUI;
public StationMaster(StationMasterGUI gui)
{
OrchCallback = new AsyncCallback(this.onReadDone);
IOBuffer = new byte[IOBufferSize];
TheGUI = gui;
this.connect();
this.loadXml();
}
private void connect()
{
try
{
OrchSock = new TcpClient(OrchHost, OrchPort);
Tools.Debug(1, "Connected to: {0} on: {1}", OrchHost, OrchPort);
OrchStream = OrchSock.GetStream();
OrchRead = new StreamReader(OrchStream);
OrchWrite = new StreamWriter(OrchStream);
}
catch (Exception err)
{
Tools.Debug(10, "Connect to {0}:{1}:{2} failed" ,OrchHost, OrchPort,
err.ToString());
}
}
socket connections. I have a C# console client that can connect to it (TCP,
port 1613).
However, when move the same code to a Compact Framework project (the client
that is, of course).
and try to use the emulator to connect to the accepting program, I get a
message about
the server actively rejecting the connection.
All IP addresses are hard coded:
public class StationMaster
{
string OrchHost = "192.168.1.50";
int OrchPort = 1613;
TcpClient OrchSock;
private NetworkStream OrchStream;
private StreamReader OrchRead;
private StreamWriter OrchWrite;
private AsyncCallback OrchCallback;
private byte[] IOBuffer;
private int IOBufferSize = 4096;
string PacketFile = "Packet.xml";
XmlDocument Xdoc = new XmlDocument();
StationMasterGUI TheGUI;
public StationMaster(StationMasterGUI gui)
{
OrchCallback = new AsyncCallback(this.onReadDone);
IOBuffer = new byte[IOBufferSize];
TheGUI = gui;
this.connect();
this.loadXml();
}
private void connect()
{
try
{
OrchSock = new TcpClient(OrchHost, OrchPort);
Tools.Debug(1, "Connected to: {0} on: {1}", OrchHost, OrchPort);
OrchStream = OrchSock.GetStream();
OrchRead = new StreamReader(OrchStream);
OrchWrite = new StreamWriter(OrchStream);
}
catch (Exception err)
{
Tools.Debug(10, "Connect to {0}:{1}:{2} failed" ,OrchHost, OrchPort,
err.ToString());
}
}