SOCKET:
SOCKET are bidirectional that meaning either side of communication is capable for both sending and reciving data.
IMPLEMENTATION OF SOCKET IN SILVERLIGHT APPLICATIONS
System.Net.Sockets Manages:
ØSystem.Net.Sockets library provides real-time duplex communication .
ØThe System.Net.Sockets namespace added in Silverlight version 2 provides a managed implementation of the sockets networking interface for developers who need to tightly control access to the network.
ØSystem.Net.Sockets namespace provides a managed implementation of the Windows Sockets (Winsock) interface.
ØSystem.Net.Sockets namespace provides a managed implementation of the sockets interface based on Berkeley Software Distribution (BSD) UNIX.
SILVERLIGHT SOCKET FRAMEWORK
ØDnsEndPoint - Represents a network endpoint as a host name of an IP address and a port number.
ØEndPoint - Identifies a network address. This is an abstract class.
ØIPAddress - Provides an Internet Protocol (IP) address.
ØIPEndPoint - Represents a network endpoint as an IP address and a port number.
ØSocketAddress - Stores serialized information from EndPoint derived classes.
SOCKET CLASS
ØNamespace: System.Net.Sockets
Assembly: System (in System.dll)
DECLARATION :
Øpublic class Socket : IDisposable
ØThe Socket class provides a rich set of methods and properties for network communications.
ØThe Socket class allows you to perform both synchronous and asynchronous data transfer using any of the communication protocols listed in the ProtocolType enumeration
SOCKET CLASS IN SILVERLIGHT:
ØSocket communication in silverlight applications must be done asynchronously.
ØIn the Socket class, asynchronous socket operations are described by reusable System.Net.Sockets.SocketAsyncEventArgs objects allocated and maintained by the application.
SOCKET OBJECT METHOD :
ØConnectAsync - Starts an asynchronous request for a connection to the remote host.
ØSendAsync - Writes outgoing data from one or more buffers on a connected socket.
ØReceiveAsync - Reads incoming data into one or more buffers from a connected socket.
ØShutdown - Finishes any pending send operations, and signals the remote endpoint that the connection should be closed. If Send is specified, data may still be received until the remote computer closes its end of the connection (indicated by receiving 0 bytes).
ØClose - Closes the remote host connection and releases all managed and unmanaged resources associated with the socket.
DISADV OF SOCKET IN SILVERLIGHT 2.0:
ØThe port range that a network application is allowed to connect to must be within the range of 4502-4534. These are the only ports allowed for connection using sockets from silverlight 2 applications.
ØIf a connection is to a port is not within this port range, the connection attempt will fail.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment