Home All Groups Group Topic Archive Search About

authentication and access control (.NET socket connection)

Author
18 Mar 2005 5:14 PM
Dan
Hi,

Can someone point me in the right direction on a really simple access
control issue?  Here is the situation:

1. an app on a client computer connected to internet and executes this kind
of code:
acceptor = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp);
acceptor.Bind(new IPEndPoint(IPAddress.Any, port));
acceptor.Listen(ListenQueueSize);
socket = acceptor.Accept();

2. on a web server executes this kind of code:
socket.Connect(new IPEndPoint(ip, port));
                        sockets[i] = socket;
                        nHosts += 1;
socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, 1);
socket.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.Linger,new
System.Net.Sockets.LingerOption(true, LingerTime));

This code executes fine, my problem is that the client asks for a user name
and password to access the server and I don't want that to happen, I want
the client (code) to know the server login so this dialog does not appear.

So my question is, how might this be done?

Thanks very much for helping!

Dan

AddThis Social Bookmark Button