unblocking a port



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


.



Relevant Pages

  • Re: Applet Hangs when submitting data to servlet
    ... to put a time limit on my socket connections and socket reads. ... public void setTimeoutthrows UnknownHostException, ... on our web server. ... private JButton theSubmitButton_, theClearButton_; ...
    (comp.lang.java.programmer)
  • Re: Can someone help me
    ... // contents from the server to the client public class AsynchNetworkFileServer {class ClientHandler {// constructor public ClientHandler(Socket socketForClient) {// initialize member variable socket = socketForClient; // initialize buffer to hold ... // contents of file buffer = new byte; // create the network stream networkStream = new NetworkStream; // set the file callback for reading ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Question on Socket disconnect handling
    ... static void SendCallback ... // simulate timing that can cause callback ... SafeSocket socket = new SafeSocket( ... private class SendCallBackArgs ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Parallel processing questions
    ... instead of from ActiveX exe. ... Did you mean that while the server socket is sending ... > RealHostName As String ... >Private Type SMTPRemoteServer ...
    (microsoft.public.vb.general.discussion)
  • Re: Applet Hangs when submitting data to servlet
    ... applet that demonstrates the problem. ... data stream from the socket connection. ... private static final long serialVersionUID = 1; ... public void actionPerformed ...
    (comp.lang.java.programmer)