Network Distributed Systems TCP IP Programming Demo
Network Distributed Systems TCP IP Programming Demo
Network Distributed Systems TCP IP Programming Demo
Programming Professional
2
)(2006/5/1328
005
/ .
:.2006
)( .
. (2006/5/1328) :
/: // // //
) ( ISBN 9957-09-255-3
:
.
Warning:
All Rights reserved, No Part of this book may be reproduced, or transmitted in any
form or by any means, electronic or mechanical, including photocopying, recording or
by any information storage retrieval system, without the prior permission in writing of
the author
3
:
TCP/IP Models Client/Server
Socket ProgrammingTransport Layer Protocols
Network Layer Programming Multicasting
Voice Chat Systems Voice
Over IP Programming TAPI Telephony Remote Desktop
Packets
Row Programming Packet Sniffing
Application Layer
.
4
:
.
:
Voice Over IP
Video Conference Systems Remote eLearning
Systems
.
5
:
Part1 Networks & TCPIP Programming Overview:
Chapter 1: TCP/IP Layers & Message Encapsulation Overview
Chapter 2: IPv4 & IPv6 Architecture Overview
Chapter 3: IP Multicasting Overview
Part2 Streaming:
Chapter 4: Streaming (Classes & Members)
Chapter 5: Applied Streaming in Dot Net
Chapter 18 Cryptography
Chapter 19 Socket Permissions
Part6 Multithreading
Chapter 20 Multithreading (Using & Managing)
6
:
Part 1 Networks & TCPIP Programming Overview:
Chapter 1: TCP/IP Layers & Message Encapsulation Overview
- IPv4 Architecture
- Classful IP Address
- Unicast IP
- Broadcast IP
- Multicast IP
- CIDR Nation Overview
- IPv6 Architecture Overview
- IP Multicasting Overview
- Using IP Multicasting in Dot Net to Create a Multicast Groups
Part2 Streaming:
- Create a Simple Remote Control Application Using Stream Reader & Writer Classes
- Create a Simple Remote Desktop Application
- Create a Simple Application to Store & Read Images (Binary Data) in Microsoft
Access & Microsoft SQL Server Database Management System By Using Streams
Library & ADO.NET
7
Part3 Transport & Network Layer Programming:
8
Part 4 Application Layer Programming:
- Serialization Programming
The Serialization (Classes & Members)
Using BinaryFormatter & SoapFormatter to Serialize Objects & Images Throw
Network
- Remotting Programming
Remotting (Classes & Members)
Using Remotting Applications in Dot Net
Create an Advanced Distributed eLearning System (Remote Class Room)
Create an Advanced Remote Desktop Application With Remote
(Mouse/Keyboard) Control Features
9
Chapter 16 SMTP & POP3 Programming ..
- SMTP Protocol
- SMTP Concept
- Using SMTP in Dot Net
- Advanced SMTP Programming
- POP3 Protocol Programming
Part6 Multithreading
Chapter 20 Multithreading Using & Managing ...
10
Appendixes (A): Classes, Members & Functions For Network Programming ...
- System.Net Namespace
- System.Net.Socket Namespace
- Socket Option Members
- System.Threading Namespace
- TAPI Telephony Functions
- Remotting TCP / HTTP Channels Members
11
Part1
Networks & TCP/IP Programming Overview
12
Chapter 1
TCP/IP Layers & Message Encapsulation Overview &
Introduction to Network Programming
13
TCP/IP Layers Encapsulation Overview : 1.1
OSI
Headers . TCP/IP
:
Application Layer
Data Chat
ASCII Code Binary Code Bits
Socket Transport Layer Network Layer Internet
Layer : Socket
14
Port Transport Layer Destination IP Network Layer
Server Client Socket Server
Port Socket Option Port
Authentication
.
Presentation
Classes Encoding Class System.Text
Namespace :ASCIIEncoding Class
C#
;)(String str=Console.ReadLine
;)(ASCIIEncoding asen= new ASCIIEncoding
;)byte[] ba=asen.GetBytes(str
VB.NET
Dim str As String = Console.ReadLine
Dim asen As ASCIIEncoding = New ASCIIEncoding
)Dim ba As Byte() = asen.GetBytes(str
Session ) (
TCP Three Way Hand Shake UDP
-1 Server IP Port
UDP .TCP
-2 Authentication Server
-3
-4 Server Listening Port
: TCP Protocol
C#:
;)TcpClient tcpclnt = new TcpClient("192.168.0.2",8001
15
VB.NET:
)Dim tcpclnt As TcpClient = New TcpClient("192.168.0.2", 8001
Client
Transport TCP -
Connection Protocol UDP - Connectionless Protocol
Port UDP
Broadcast Port
) Multicasting (Group Broadcast IP Multicast
IP Port ) Socket Broadcast IP Multicast IP
(
TCP Class
NetworkStream
Stream Data Socket :
C#:
;)( NetworkStream mynetsream = tcpclnt.GetStream
;)StreamWriter myswrite = new StreamWriter (mynetsream
;)"myswrite.WriteLine("Your Message
;)( myswrite.Close
;)( mynetsream.Close
;)( tcpclnt.Close
VB.NET:
Dim mynetsream As NetworkStream = tcpclnt.GetStream
)Dim myswrite As StreamWriter = New StreamWriter(mynetsream
)"myswrite.WriteLine("Your Message
)( myswrite.Close
)( mynetsream.Close
)( tcpclnt.Close
Network Layer
Physical Tunnel Network Layer
IP,IPv6,ARB-Address Resolution Protocol
...
Server
Bits Data link Layer Network Layer Transport Layer
Application Layer Binary ASCII ASCII Text
Stream Classes .. : Server
C#:
16
using System.IO;
using System.Net.Sockets;
using System.Threading;
TcpListener mylistener;
NetworkStream myntl;
public void Listener()
{
mylistener = new TcpListener(8001);
mylistener.Start();
Socket mysocket;
StreamReader str;
while (true)
{
mysocket = mylistener.AcceptSocket();
myntl = new NetworkStream(mysocket);
str = new StreamReader(myntl);
textbox1.Text = str.ReadToEnd();
}
}
}
VB.NET:
Imports System.IO
Imports System.Net.Sockets
Imports System.Threading
17
Infinity Loop Loop
Thread Form Loop
Infinity Loop Multithreading
Session
..Multitasking
Infinity Loop :
C#:
;using System.Threading
VB.NET:
imports System.Threading
C#:
;Thread myth
;))myth= new Thread (new System.Threading .ThreadStart(Listener
;)( myth.Start
18
VB.NET:
Imports System.Threading
Dim myth As Thread
myth = New Thread(New System.Threading.ThreadStart(Listener))
myth.Start
C#:
private void Form1_Closing(object sender,
System.ComponentModel.CancelEventArgs e)
{
mylistener.Stop();
myth.Abort();
}
VB.NET:
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs)
Try
mylistener.Stop()
myth.Aport() ()
Catch ex As Exception
Msgbox(ex.Message)
End Try
End Sub
Thread Thread
... Multithreading
19
Encapsulation Internet Encapsulation Ethernet
Encapsulation Data Link Layer :
20
Packet :
21
Ethereal Packet Sniffing
:
http://www.ethereal.com/download.html
Ethereal
Network Interface Card Google Internet
:Explorer
22
TCP / UDP Connection Establishment : 1.2
TCP Three-way hand-shake
:
-3
Acknowledgment .
23
UDP Acknowledgments UDP
TCP .
24
TCP & UDP Header Encapsulation : 1.3
Transport Layer TCP UDP
Stream Unicast TCP
Broadcast Multicast UDP
TCP ... UDP
25
: Sequence & Acknowledgment Number 1.3.1.2
32 Bits Packet
Acknowledgment Packet
:
26
: Window Size 1.3.1.4
Packet SYN
Packet ACK Packet Packet
.
27
Buffer Urgent Pointer Data
Buffer :
28
Image
: Client/Server
: Namespaces
C#:
using System.Net.Socket;
using System.IO;
VB.NET:
Imports System.Net.Socket
Imports System.IO
MemoryStream Instance
Binary
:Server Socket NetworkStream
C#:
try
{
openFileDialog1.ShowDialog ();
string mypic_path =openFileDialog1.FileName ;
pictureBox1.Image = Image.FromFile(mypic_path);
MemoryStream ms = new MemoryStream();
pictureBox1.Image.Save(ms,pictureBox1.Image.RawFormat);
byte[] arrImage = ms.GetBuffer();
ms.Close();
TcpClient myclient = new TcpClient (txt_host.Text,5020);//Connecting with The
server
NetworkStream myns = myclient.GetStream ();
BinaryWriter mysw = new BinaryWriter (myns);
mysw.Write(arrImage);//send the stream to The above address
29
mysw.Close ();
myns.Close ();
myclient.Close ();
}
catch (Exception ex){MessageBox.Show(ex.Message );}
VB.NET:
openFileDialog1.ShowDialog
Dim mypic_path As String = openFileDialog1.FileName
pictureBox1.Image = Image.FromFile(mypic_path)
Dim ms As MemoryStream = New MemoryStream
pictureBox1.Image.Save(ms, pictureBox1.Image.RawFormat)
Dim arrImage As Byte() = ms.GetBuffer
ms.Close
Dim myclient As TcpClient = New TcpClient(txt_host.Text, 5020)
Try
Dim myns As NetworkStream = myclient.GetStream
Dim mysw As BinaryWriter = New BinaryWriter(myns)
mysw.Write(arrImage)
mysw.Close
myns.Close
myclient.Close
Catch ex As Exception
Msgbox(ex.Message)
End Try
30
:
C#:
using System.Net.Socket ;
using System.IO;
31
VB.NET:
Private mytcpl As TcpListener
Private mysocket As Socket
Private pictureBox1 As System.Windows.Forms.PictureBox
Private mainMenu1 As System.Windows.Forms.MainMenu
Private menuItem1 As System.Windows.Forms.MenuItem
Private saveFileDialog1 As System.Windows.Forms.SaveFileDialog
Private myns As NetworkStream
Sub Image_Receiver()
mytcpl = New TcpListener(5000)
mytcpl.Start()
mysocket = mytcpl.AcceptSocket
myns = New NetworkStream(mysocket)
pictureBox1.Image = Image.FromStream(myns)
mytcpl.Stop()
If mysocket.Connected = True Then
While True
Image_Receiver()
End While
End If
End Sub
C#:
Thread myth;
myth= new Thread (new System.Threading .ThreadStart(Image_Receiver));
myth.Start ();
VB.NET:
Imports System.Threading
Dim myth As Thread
myth = New Thread(New System.Threading.ThreadStart(Image_Receiver))
myth.Start
32
: Form Closing Event Socket Thread
C#:
private void Form1_Closing(object sender,
System.ComponentModel.CancelEventArgs e)
{
try
{
mytcpl.Stop ();
thread.Aport();
}
catch (Exception ex) {MessageBox .Show (ex.Message );}
}
VB.NET:
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs)
Try
mytcpl.Stop()
thread.Aport()
Catch ex As Exception
Msgbox(ex.Message)
End Try
End Sub
: Save Button
C#:
try
{
saveFileDialog1.Filter = "JPEG Image (*.jpg)|*.jpg" ;
if(saveFileDialog1.ShowDialog() == DialogResult.OK)
{
string mypic_path = saveFileDialog1.FileName;
pictureBox1.Image.Save(mypic_path);
}
}
catch (Exception)
{
}
33
VB.NET:
Try
"saveFileDialog1.Filter = "JPEG Image (*.jpg)|*.jpg
If saveFileDialog1.ShowDialog = DialogResult.OK Then
Dim mypic_path As String = saveFileDialog1.FileName
)pictureBox1.Image.Save(mypic_path
End If
Catch generatedExceptionVariable0 As Exception
End Try
34
UDP System.Net Namespace
System.Net.Socket TCP Port
UDP TCP Broadcast IPAddress.Any
IPAddress.Broadcast IPEndPoint
Port 0 Bind Method Socket
.
)1
C#:
;)IPEndPoint ipep = new IPEndPoint(IPAddress.Any, 5020
VB.NET
)Dim ipep As IPEndPoint = New IPEndPoint(IPAddress.Any, 5020
Socket :
)2
C#:
Socket newsock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram,
)ProtocolType.Udp
VB.NET
Dim newsock As Socket = New Socket(AddressFamily.InterNetwork,
)SocketType.Dgram, ProtocolType.Udp
VB.NET:
)newsock.Bind(ipep
Server Port
IPEndPoint Object :
)4
35
C#:
IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0);
EndPoint Remote = (EndPoint)(sender);
recv = newsock.ReceiveFrom(data, ref Remote);
VB.NET:
Dim sender As IPEndPoint = New IPEndPoint(IPAddress.Any, 0)
Dim Remote As EndPoint = CType((sender), EndPoint)
recv = newsock.ReceiveFrom(data, Remote)
:
5)
C#:
Console.WriteLine("Message received from {0}:", Remote.ToString());
Console.WriteLine(Encoding.ASCII.GetString(data, 0, recv));
VB.NET:
Console.WriteLine("Message received from {0}:", Remote.ToString)
Console.WriteLine(Encoding.ASCII.GetString(Data, 0, recv))
Server
:
C#:
string welcome = "Welcome Customer ...";
data = Encoding.ASCII.GetBytes(welcome);
newsock.SendTo(data, data.Length, SocketFlags.None, Remote);
VB.NET:
Dim welcome As String = "Welcome Customer ..."
Data = Encoding.ASCII.GetBytes(welcome)
newsock.SendTo(Data, Data.Length, SocketFlags.None, Remote)
: Infinity Loop
... Server
.. infinity loop True
C#:
while(true)
{
36
data = new byte[1024];
recv = newsock.ReceiveFrom(data, ref Remote);
Console.WriteLine(Encoding.ASCII.GetString(data, 0, recv));
newsock.SendTo(data, recv, SocketFlags.None, Remote);
}
server.Close();
VB.NET:
While True
Data = New Byte(1024)
recv = newsock.ReceiveFrom(Data, Remote)
Console.WriteLine(Encoding.ASCII.GetString(Data, 0, recv))
newsock.SendTo(Data, recv, SocketFlags.None, Remote)
End While
server.Close()
class SimpleUdpSrvr
{
public static void Main()
{
int recv;
byte[] data = new byte[1024];
IPEndPoint ipep = new IPEndPoint(IPAddress.Any, 5020);
Socket newsock = new Socket(AddressFamily.InterNetwork,
SocketType.Dgram, ProtocolType.Udp);
newsock.Bind(ipep);
Console.WriteLine("Waiting for a client...");
37
IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0);
EndPoint Remote = (EndPoint)(sender);
recv = newsock.ReceiveFrom(data, ref Remote);
Console.WriteLine("Message received from {0}:", Remote.ToString());
Console.WriteLine(Encoding.ASCII.GetString(data, 0, recv));
string welcome = " Welcome Customer ...";
data = Encoding.ASCII.GetBytes(welcome);
newsock.SendTo(data, data.Length, SocketFlags.None, Remote);
while (true)
{
data = new byte[1024];
recv = newsock.ReceiveFrom(data, ref Remote);
Console.WriteLine(Encoding.ASCII.GetString(data, 0, recv));
newsock.SendTo(data, recv, SocketFlags.None, Remote);
}
}
}
VB.NET:
Imports System
Imports System.Net
Imports System.Net.Socket
Imports System.Text
Class SimpleUdpSrvr
newsock.Bind(ipep)
Console.WriteLine("Waiting for a client...")
Dim sender As IPEndPoint = New IPEndPoint(IPAddress.Any, 0)
Dim Remote As EndPoint = CType((sender), EndPoint)
recv = newsock.ReceiveFrom(data, Remote)
Console.WriteLine("Message received from {0}:", Remote.ToString)
Console.WriteLine(Encoding.ASCII.GetString(data, 0, recv))
Dim welcome As String = " Welcome Customer ..."
data = Encoding.ASCII.GetBytes(welcome)
newsock.SendTo(data, data.Length, SocketFlags.None, Remote)
38
While True
data = New Byte(1024)
recv = newsock.ReceiveFrom(data, Remote)
Console.WriteLine(Encoding.ASCII.GetString(data, 0, recv))
newsock.SendTo(data, recv, SocketFlags.None, Remote)
End While
End Sub
End Class
C#:
using System;
using System.Net;
using System.Net.Socket;
using System.Text;
class SimpleUdpClient
{
public static void Main()
{
byte[] data = new byte[1024]; string input, stringData;
IPEndPoint ipep = new IPEndPoint( IPAddress.Parse("127.0.0.1"), 5020);
Socket server = new Socket(AddressFamily.InterNetwork,SocketType.Dgram,
ProtocolType.Udp);
string welcome = "Hello, are you there?";
data = Encoding.ASCII.GetBytes(welcome);
server.SendTo(data, data.Length, SocketFlags.None, ipep);
IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0);
EndPoint Remote = (EndPoint)sender;
data = new byte[1024];
int recv = server.ReceiveFrom(data, ref Remote);
Console.WriteLine("Message received from {0}:", Remote.ToString());
Console.WriteLine(Encoding.ASCII.GetString(data, 0, recv));
while(true)
{
input = Console.ReadLine();
Exit
if (input == "exit")
break;
39
server.SendTo(Encoding.ASCII.GetBytes(input), Remote);
data = new byte[1024];
40
recv = server.ReceiveFrom(data, ref Remote);
stringData = Encoding.ASCII.GetString(data, 0, recv);
Console.WriteLine(stringData);
}
Console.WriteLine("Stopping client");
server.Close();
}
}
VB.NET:
Imports System
Imports System.Net
Imports System.Net.Socket
Imports System.Text
Class SimpleUdpClient
Public Shared Sub Main()
Dim data(1024) As Byte
Dim input As String
Dim stringData As String
Dim ipep As IPEndPoint = New IPEndPoint(IPAddress.Parse("127.0.0.1"), 5020)
Dim server As Socket = New Socket(AddressFamily.InterNetwork,
SocketType.Dgram, ProtocolType.Udp)
Dim welcome As String = "Hello, are you there?"
data = Encoding.ASCII.GetBytes(welcome)
server.SendTo(data, data.Length, SocketFlags.None, ipep)
Dim sender As IPEndPoint = New IPEndPoint(IPAddress.Any, 0)
Dim Remote As EndPoint = CType(sender, EndPoint)
data = New Byte(1024)
Dim recv As Integer = server.ReceiveFrom(data, Remote)
Console.WriteLine("Message received from {0}:", Remote.ToString)
Console.WriteLine(Encoding.ASCII.GetString(data, 0, recv))
While True
input = Console.ReadLine
If input = "exit" Then
' break
End If
server.SendTo(Encoding.ASCII.GetBytes(input), Remote)
data = New Byte(1024)
recv = server.ReceiveFrom(data, Remote)
stringData = Encoding.ASCII.GetString(data, 0, recv)
Console.WriteLine(stringData)
41
End While
Console.WriteLine("Stopping client")
server.Close()
End Sub
End Class
C#: - Client
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
public class Broadcast
{
public static void Main()
{
Socket sock = new Socket(AddressFamily.InterNetwork,
SocketType.Dgram, ProtocolType.Udp);
IPEndPoint iep = new IPEndPoint(IPAddress.Broadcast, 5000);
byte[] data = Encoding.ASCII.GetBytes(Hello All);
sock.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.Broadcast, 1);
sock.SendTo(data, iep);
sock.Close();
}
}
42
VB.NET:- Client
Imports System
Imports System.Net
Imports System.Net.Sockets
Imports System.Text
Public Class Broadcast
Public Shared Sub Main()
Dim sock As Socket = New Socket(AddressFamily.InterNetwork,
SocketType.Dgram, ProtocolType.Udp)
Dim iep As IPEndPoint = New IPEndPoint(IPAddress.Broadcast, 5000)
Dim data As Byte() = Encoding.ASCII.GetBytes(Hello All)
sock.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast,
1)
sock.SendTo(data, iep)
sock.Close()
End Sub
End Class
C#: - Server
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
public class RecvBroadcst
{
public static void Main()
{
Socket sock = new
Socket(AddressFamily.InterNetwork,SocketType.Dgram, ProtocolType.Udp);
IPEndPoint iep = new IPEndPoint(IPAddress.Any, 5000);
sock.Bind(iep);
EndPoint ep = (EndPoint)iep;
Console.WriteLine("Ready to receive...");
byte[] data = new byte[1024];
int recv = sock.ReceiveFrom(data, ref ep);
string stringData = Encoding.ASCII.GetString(data, 0, recv);
Console.WriteLine("received: {0} from: {1}",stringData,
ep.ToString());
}
}
43
VB.NET:- Server
Imports System
Imports System.Net
Imports System.Net.Sockets
Imports System.Text
Public Class RecvBroadcst
Public Shared Sub Main()
Dim sock As Socket = New Socket(AddressFamily.InterNetwork,
SocketType.Dgram, ProtocolType.Udp)
Dim iep As IPEndPoint = New IPEndPoint(IPAddress.Any, 5000)
sock.Bind(iep)
Dim ep As EndPoint = CType(iep, EndPoint)
Console.WriteLine("Ready to receive...")
Dim data As Byte() = New Byte(1023)
Dim recv As Integer = sock.ReceiveFrom(data, ep)
Dim stringData As String = Encoding.ASCII.GetString(data, 0, recv)
Console.WriteLine("received: {0} from: {1}", stringData, ep.ToString())
End Sub
End Class
44
Chapter 2
IPv4 & IPv6 Architecture Overview
- IPv4 Architecture
- Classful IP Address
i. Unicast IP
ii. Broadcast IP
iii. Multicast IP
45
The Internet Protocol:
Network Layer Packet IP
Transport Layer TCP
Unicast UDP
Unicast Multicast Broadcast
IPv4 Unicast Multicast Broadcast:
)Data = total Length (20 Bytes for IPv4 Header+ 20 Bytes For TCP Header
46
8 Bits TTL Time to Live Hops Routers
Packet 16 hops Router
1 .
8 Bits Upper Layer TCP ... UDP
16 Bits Checksum TCP UDP
.
32 Bits
32 Bits
47
Broadcast Bits Host ID
Broadcast Address 10.0.0.1 Class
Class A Network ID 10 1
126 Host ID 0.0.1 Broadcast Address 255
Host ID 10.255.255.255 : Broadcast Address
Class A ... Classful Nation
48
8 8 6
192 168 1 0
11111111 11111111 11111100 00000000
CIDR
IPv6 32 Bits
128 Bits .
- IPv4 Address
IPs .
- IPv4 Routing Table IPv6
- Security IPv4 Authentication
Network Layer IPv4 IPSec
IP Port Socket Security
. Network Layer
- Broadcast any cast
Router
Bandwidth .
49
IPv6 hexadecimal Decimal IPv4
:
69dc:8864:ffff:ffff:0:1280:8c0a:ffff
50
- Geographic-based Addresses
)a Registry ID
)b World Zone
)c Country, City, etc.
51
Chapter 3
IP Multicasting Programming Overview
- IP Multicasting Overview
52
: IP Multicasting Overview :3.1
UDP
Server Port
IPAddress.Broadcast
Server
Port Broadcast
IP Multicasting Multicast Group
) (
Conferences Multicast
Managed Client/Server Server
Client
:
Clients Server
IP Address List IP Multicast
IP Multicast Class D
.
peer-to-peer Technique - unmanaged server
client Server
:
53
Multicasting IP Multicast Address :
224.0.0.0 224.0.0.255 LAN
224.0.1.0 224.0.1.255 Internetwork
224.0.2.0 224.0.255.255 AD-HOC Network block
...
C#:
;using System
;using System.Net
;using System.Net.Socket
;using System.Text
class MultiSend
{
)(public static void Main
{
Socket server = new Socket(AddressFamily.InterNetwork,
;)SocketType.Dgram, ProtocolType.Udp
54
IPEndPoint iep = new IPEndPoint(IPAddress.Parse("224.100.0.1"), 5020);
byte[] data = Encoding.ASCII.GetBytes("This is a test message");
server.SendTo(data, iep);
server.Close();
}
}
VB.NET:
Imports System
Imports System.Net
Imports System.Net.Socket
Imports System.Text
Class MultiSend
Socket )Socket
... Socket ( IP Multicast Group
class UdpClientMultiRecv
{
public static void Main()
{
UdpClient sock = new UdpClient(5020);
sock.JoinMulticastGroup(IPAddress.Parse("224.100.0.1"), 50);
55
IPEndPoint iep = new IPEndPoint(IPAddress.Any, 0);
VB.NET:
Imports System
Imports System.Net
Imports System.Net.Socket
Imports System.Text
Class UdpClientMultiRecv
Binary
Byte Array memory Stream
Shutdown Clients
Multicast Group
Advanced Multicast
... Systems
56
: Multithreading
.
: Keyboard Listening
Mouse ...
: .Remotting
: Real Applications
.
: CD
57
-1 - - -
0096265350649
-2 - - - 4611548
-3 - - - 5330211
-4 - - -
5340383 5345711
-5 - - -
5335837
http://www.fadidotnet.org/full_version.htm
fadi@fadidotnet.org
58