Hi,
try with:
socket.Bind(new IPEndPoint(IPAddress.Any, 1234);
this will bind the socket to all adapters.
If it works, you have to investigate why and if DNS resolve returns
different IPAddresses on the client and on the server.
Sunny
In article <u2RnzF1bEHA.1408@TK2MSFTNGP12.phx.gbl>,
please_dont.spam.deutronium@gmx.de says...[color=blue][color=green]
> > what happens if with listening started you call from command prompt:
> >
> > telnet localhost 1234?[/color]
>
> Good idea I'll try it tomorrow in my company.
>[color=green]
> > Also, how you create the listener?[/color]
>
> I do not have the src here but I think I did it this way:
>
> IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName());
> IPAddress ipAddress = ipHostInfo.AddressList[0];
> Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
> ProtocolType.Tcp);
> socket.Bind(new IPEndPoint(ipAddress, 1234));
> socket.Listen(10);
> Socket s = socket.Accept(); // exception thrown here
>[color=green]
> > In article <#TvDGjzbEHA.1144@TK2MSFTNGP11.phx.gbl>,
> >
no_spam_deutronium@gmx.net says...[color=darkred]
> > > Hi I'm created a socket listening on port 1234 (it is shown that this[/color][/color]
> post[color=green][color=darkred]
> > > is in listening mode if I use NETSTAT). Now Iam trying to connect to[/color][/color]
> this[color=green][color=darkred]
> > > port:
> > >
> > > IPHostEntry entry = Dns.Resolve("localhost");
> > > serverConn = new Socket(entry.AddressList[0].AddressFamily,
> > > SocketType.Stream, ProtocolType.Tcp);
> > > IPEndPoint endpoint = new IPEndPoint(entry.AddressList[0], 1234);
> > > serverConn.Connect(endpoint);
> > >
> > > But I get a SocketException that the remotecomputer has denied the
> > > connection request. What could be the cause of this? Both apps running[/color][/color]
> local[color=green][color=darkred]
> > > and I have no firewall (Win2K).
> > >
> > > I tried Accept() in blocking and nonblocking mode on the server but[/color][/color]
> neither[color=green][color=darkred]
> > > worked.[/color][/color]
>
>
>[/color]