W
WAkthar
Hi
I have a simple socket program which needs to connect and send an xml stream
through sockets.
private int nCommPort = 4555;
private string HostName = "localhost";
private Socket TcpSocket;
private XmlDocument objXmlDocument;
IPAddress HostIP = Dns.Resolve(HostName).AddressList[0];
IPEndPoint HostEP = new IPEndPoint(HostIP,nCommPort);
TcpSocket = new
Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);
// Get the client name
string strHome = Dns.GetHostName();
string strMessage = "Hello from " + strHome;
byte[] byteMessage =
System.Text.Encoding.ASCII.GetBytes(strMessage.ToCharArray());
// Connect to Server
TcpSocket.Connect(HostEP);
if(TcpSocket.Connected)
{
:
:
}
I get an error
Additional information: No connection could be made because the target
machine actively refused it
When I ran it first I got the usual XP message box asking whether to block
or unblock this program. Unfortunatley I presses block instead of unblock.
How can I unblock this now!!
Cheers
I have a simple socket program which needs to connect and send an xml stream
through sockets.
private int nCommPort = 4555;
private string HostName = "localhost";
private Socket TcpSocket;
private XmlDocument objXmlDocument;
IPAddress HostIP = Dns.Resolve(HostName).AddressList[0];
IPEndPoint HostEP = new IPEndPoint(HostIP,nCommPort);
TcpSocket = new
Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);
// Get the client name
string strHome = Dns.GetHostName();
string strMessage = "Hello from " + strHome;
byte[] byteMessage =
System.Text.Encoding.ASCII.GetBytes(strMessage.ToCharArray());
// Connect to Server
TcpSocket.Connect(HostEP);
if(TcpSocket.Connected)
{
:
:
}
I get an error
Additional information: No connection could be made because the target
machine actively refused it
When I ran it first I got the usual XP message box asking whether to block
or unblock this program. Unfortunatley I presses block instead of unblock.
How can I unblock this now!!
Cheers