Click here to Skip to main content
15,906,301 members
Home / Discussions / C#
   

C#

 
GeneralRe: Encryption/Decryption problem Pin
3ddA1-Oct-03 6:31
3ddA1-Oct-03 6:31 
GeneralRe: Encryption/Decryption problem, prettier code now Pin
3ddA1-Oct-03 7:28
3ddA1-Oct-03 7:28 
GeneralTCP Remote Endpoints Pin
Tatham30-Sep-03 19:50
Tatham30-Sep-03 19:50 
GeneralRe: TCP Remote Endpoints Pin
Blake Coverett1-Oct-03 1:36
Blake Coverett1-Oct-03 1:36 
GeneralRe: TCP Remote Endpoints Pin
Tatham1-Oct-03 4:03
Tatham1-Oct-03 4:03 
GeneralRe: TCP Remote Endpoints Pin
Blake Coverett1-Oct-03 8:25
Blake Coverett1-Oct-03 8:25 
GeneralRe: TCP Remote Endpoints Pin
Tatham2-Oct-03 3:09
Tatham2-Oct-03 3:09 
GeneralRe: TCP Remote Endpoints Pin
Blake Coverett2-Oct-03 8:50
Blake Coverett2-Oct-03 8:50 
I'm glad to hear the problem is solved.

On the merits of TcpListener as a wrapper:

If you look through the source for it (isn't Reflector a wonderful tool) you'll see it's all of about 40 lines of code. Really all it does is wrap Bind/Listen in one method and, create TcpClients around accepted sockets, and translate from one set of exceptions to a different set if you try to accept on a closed socket.

What does this actually really buy, except hiding the real Socket's based programming model? Perhaps the thought is it buy's having TcpClients rather than sockets after the connect, but they don't add any value in a server scenario at all. The only real abstraction they provide is in the Connect process, which isn't used there.

Perhaps what you want is the NetworkStream model for the actual IO. I might argue that too on different grounds, but I won't today. If that's what you want, then then just do a new NetworkStream(listeningSocket.Accept(), true).

Of course, better yet is to use the async Socket.BeginAccept/BeginRead/BeginWrite methods. This is where you'll get scalability.

regards,
-Blake
GeneralGeting/seting properties on files. Pin
Mattias Olgerfelt30-Sep-03 14:41
Mattias Olgerfelt30-Sep-03 14:41 
GeneralRe: Geting/seting properties on files. Pin
J. Dunlap30-Sep-03 15:05
J. Dunlap30-Sep-03 15:05 
GeneralRe: Geting/seting properties on files. Pin
Mattias Olgerfelt2-Oct-03 14:46
Mattias Olgerfelt2-Oct-03 14:46 
GeneralTransparent Background for PocketPC Pin
Rowdy12330-Sep-03 14:07
Rowdy12330-Sep-03 14:07 
GeneralRe: Transparent Background for PocketPC Pin
J. Dunlap30-Sep-03 14:12
J. Dunlap30-Sep-03 14:12 
GeneralRe: Transparent Background for PocketPC Pin
Rowdy12330-Sep-03 14:22
Rowdy12330-Sep-03 14:22 
GeneralRe: Transparent Background for PocketPC Pin
J. Dunlap30-Sep-03 14:28
J. Dunlap30-Sep-03 14:28 
QuestionFile/Folder Name Problems - How to get around? Pin
Khang Nguyen30-Sep-03 12:44
Khang Nguyen30-Sep-03 12:44 
AnswerRe: File/Folder Name Problems - How to get around? Pin
Meysam Mahfouzi30-Sep-03 18:03
Meysam Mahfouzi30-Sep-03 18:03 
GeneralProblem with winsock programming with character encoding. Pin
Andrlage30-Sep-03 11:14
Andrlage30-Sep-03 11:14 
GeneralSpecialized Collection/List Pin
J. Dunlap30-Sep-03 10:44
J. Dunlap30-Sep-03 10:44 
GeneralRe: Specialized Collection/List Pin
leppie30-Sep-03 12:01
leppie30-Sep-03 12:01 
GeneralRe: Specialized Collection/List Pin
leppie30-Sep-03 12:22
leppie30-Sep-03 12:22 
GeneralRe: Specialized Collection/List Pin
J. Dunlap30-Sep-03 12:25
J. Dunlap30-Sep-03 12:25 
GeneralRe: Specialized Collection/List Pin
leppie30-Sep-03 12:30
leppie30-Sep-03 12:30 
GeneralRe: Specialized Collection/List Pin
J. Dunlap30-Sep-03 13:37
J. Dunlap30-Sep-03 13:37 
GeneralRe: Specialized Collection/List Pin
Joel Holdsworth14-Oct-03 12:09
Joel Holdsworth14-Oct-03 12:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.