[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

Re: Socket Help (Client/Server App)

feroze [msft]

7/1/2004 8:42:00 AM

I dont disagree with you that Eventing model is important for a good
developer experience, esp for the begining developer. However, eventing is
not the be-all and end-all of writing a non-blocking application.

I disagree with your assertion that System.Net.Sockets implementation is
poor in comparison to native winsock2 apis. The Sockets classes are based on
tthe winsock2 apis. On WindowsNT platforms, we use I/O completionports to
give you the best performance. On Win9x platforms, Overlapped I/O is used.
In this case you might see an extra thread.

On NT, there is no extra thread created when you use async i/o.

feroze
=====================================

"Yuancai (Charlie) Ye" <someone@yahoo.com> wrote in message
news:%23NW%23k6zQEHA.4000@TK2MSFTNGP10.phx.gbl...
> Hi,
> These events are extremely important for developing a full
non-blocking
> socket application. Dotnet socket implementation is poor in comparison to
> native window system socket 2 APIs. System.Net.Sockets.Socket class
supports
> asynchronous usage through dotnet interface IAsyncResult with creating
extra
> threads. Native window system socket 2 APIs do not require extra threads
at
> all, which avoids all of thread side effects such as dead lock and data
> synchronization etc.
>
> --
> Yuancai (Charlie) Ye
>
> Fast and securely accessing all of remote data sources anywhere with
> SocketPro using batch/queue, asynchrony and parallel computation with
online
> compressing
>
> See 30 well-tested and real OLEDB examples
>
> www.udaparts.com
>
>
> "Feroze [MSFT]" <ferozed@online.microsoft.com> wrote in message
> news:40b27d76$1@news.microsoft.com...
> > Can you give more information on why you think "dotnet has very little
> > support on non-blockiing socket" ?
> >
> > System.Net.Sockets.Socket class supports asynchronous usage. If there
are
> > particular issues that you found, I would be happy to hear about them.
> >
> > As regards events: yes, Sockets doesnt support events, although we are
> > working to rectify this in a future version.
> >
> > THanks.
> > --
> > feroze
> > http://weblogs.asp.net/f...
> > ============
> >
> > Remove "user" from the email address to reply to the author.
> >
> > This posting is provided "AS IS" with no warranties, and confers no
rights
> >
> > Use of included script samples are subject to the terms specified at
> > http://www.microsoft.com/info/cp...
> >
> >
> >
> >
> > "Yuancai (Charlie) Ye" <someone@yahoo.com> wrote in message
> > news:uoJZv7OPEHA.2452@TK2MSFTNGP11.phx.gbl...
> > > Hi,
> > > At this time, dotNet mainly supports blocking socket. dotNet has
> very
> > > little support to non-blocking socket and forgets all of socket
> > > communication events such as OnClose, OnAccept, OnDataArrive, OnWrite,
> > > OnConnect etc. You must fight your problems by sending data
periodically
> > for
> > > detecting network connection. It is truly ugly, but you have no other
> > > choice. Our SocketPro implements these events. For details, see the VB
> > > samples inside the package SocketPro at www.udaparts.com
> > >
> > > --
> > > Yuancai (Charlie) Ye
> > >
> > > Fast and securely accessing all of remote data sources anywhere with
> > > SocketPro using batch/queue, asynchrony and parallel computation
> > >
> > > See 30 well-tested and real OLEDB examples
> > >
> > > RDB, a tool for fast and securely accessing remote databases with
> dial-up,
> > > cable, DSL and wireless modems anywhere
> > > www.udaparts.com
> > >
> > >
> > > "Ghazanfer" <anonymous@discussions.microsoft.com> wrote in message
> > > news:86324324-0E58-4529-9B85-158BEA77BC35@microsoft.com...
> > > > I have made a client server app in VB.Net. I used Tcpistener in
server
> > app
> > > and TcpClient in client app. My server supports multiple clients.
There
> is
> > a
> > > separate thread for each client that connets to the server so they can
> > > exchange msgs. The problem i m facing is that when i close the Client
> app
> > > the client socket on the server side dose not close. I ckeched it by
> > > retreiving the protected property of TcpClient 'Client' to check
whether
> > the
> > > scoket is connected or not. Its 'Connected' property returns true that
> > > means the client socket is alive. Due to this problem i can not
> close/exit
> > > the respective client thread.
> > > >
> > > >
> > > > please help.
> > >
> > >
> >
> >
>
>