SlideShare a Scribd company logo
1 of 18
S.NO. PROGRAM NAME REMARK
1.
What is the network.
2.
Overview of OSI model.
3.
Define the IP & IPv4
Why IP address
4.
IP header , IPv4 range
5.
What is the socket ,
Type of socket
6.
Write the socket program .
1. What is the networks ?
A collection of two or more computers interconnected by the
telephone lines, co-axial cable, satellite links, radio and microwave
transmission and some other communication techniques. A
computer network is a group of computers that are connected
together and that communicate with one another for a common
purpose.
Although the computer industry is young compared to anther
industries (e.g., automobiles air transportation), computer have
made spectacular progress in a short time. During the first two
decades of their extrinsic, computer system highly centralized,
usually a single large room. A medium size company or university
might have had one or two computers, while large instructions had
at most a few dozen. The idea that with in 20 years equally powerful
computers smaller than postage stamps would be mass produced by
the millions was pure science fiction.
The merging of computers & communications has had a profound
influence on the way computer systems are organized. The concept
of the computer center as a room with a large computer to which
users bring their work for processing is now totally obsolete. The old
model of single computer serving all of the organizations
computational needs has been replaced by one in which a large
number of separate but interconnected computers do the job. These
systems are called computer networks.
1 .Overview of OSI model ?
The Open Systems Interconnection model (OSI model) is
a conceptual model that characterize standardizes
thecommunication functions of a telecommunication or
computing system without regard to their underlying internal
structure and technology. Its goal is the interoperability of
diverse communication systems with standard protocols.
The Seven Layers of the OSI Model
2. Define the IPv4 ?
Internet Protocol Characteristics
 Operates at network layer of OSI
 Connectionlessprotocol
 Packets treated independently
 Hierarchical addressing
 Best-effort delivery
 No data-recovery features
Why IP Addresses?
 They uniquelyidentify each device on an IP
network.
 Every host (computer, networking device,
peripheral) must have a uniqueaddress.
 Host ID:
– Identifies the individual host
– Is assigned by organizationsto individual
devices
IP PDU Header
IP Address Format: Dotted Decimal Notation
IP Address Ranges
Class A addresses begin with 0xxx, or 1 to 126 decimal.
Class B addresses begin with 10xx, or 128 to 191 decimal.
Class C addresses begin with 110x, or 192 to 223 decimal.
Class D addresses begin with 1110, or 224 to 239 decimal.
Class E addresses begin with 1111, or 240 to 254 decimal.
*127 (01111111) is a Class A address reserved for loopback
testing and cannot be assigned to a network.
What is the socket ?
A network socket is one endpoint in a communication flow
between two programs running over a network.
Sockets allow communication between two different
processes on the same or different machines.
A Unix Socket is used in client-server application framework.
A server is a process that performs some functions on
request from a client. Most of the application-level protocols
like FTP, SMTP, and POP3 make use of sockets to establish
connection between client & server and then for exchanging
data.
If everything goes well, the server accepts the connection
SocketTypes
There are four types of sockets available to the users. The
first two are most commonly used and the last two are
rarely used.
 Stream Sockets − Delivery in a networked environment
is guaranteed. If you send through the stream socket
three items "A, B, C", they will arrive in the same order
− "A, B, C". These sockets use TCP (Transmission Control
Protocol) for data transmission. If delivery is impossible,
the sender receives an error indicator. Data records do
not have any boundaries.
 Datagram Sockets − Delivery in a networked
environment is not guaranteed. They're connectionless
because you don't need to have an open connection as
in Stream Sockets − you build a packet with the
destination information and send it out.
Raw Sockets − These provide users access to the underlying
communication protocols, which support socket
abstractions. These sockets are normally datagram oriented,
though their exact characteristics are dependent on the
interface provided by the protocol. Raw sockets are not
intended for the general user; they have been provided
mainly for those interested in developing new
communication protocols, or for gaining access to some of
the more cryptic facilities of an existing protocol.
 Sequenced Packet Sockets − They are similar to a
stream socket, with the exception that record
boundaries are preserved.
WAP to implement Chat server using Socket Programming.
using System;
using System.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingSystem.Windows.Forms;
usingSystem.Net.Sockets;
using System.Net;
namespaceSocketProgramming
{
publicpartialclassForm1: Form
{
Socketskt;
EndPointclientep, remoteep;
public Form1()
{
InitializeComponent();
skt = newSocket(AddressFamily.InterNetwork,
SocketType.Dgram, ProtocolType.Udp);
skt.SetSocketOption(SocketOptionLevel.Socket,SocketOptio
nName.ReuseAddress,true);
textBox1.Text = callerip();
textBox2.Text = callerip();
}
privatestringcallerip()
{
IPAddress host;
IPHostEntry host1;
host1 = Dns.GetHostEntry(Dns.GetHostName());
foreach (IPAddressipin host1.AddressList)
{
if (ip.AddressFamily== AddressFamily.InterNetwork)
{
returnip.ToString();
}
}
return"172.251.1.0";
}
privatevoid listBox1_SelectedIndexChanged(object sender,
EventArgs e)
{
}
privatevoid button2_Click(object sender, EventArgs e)
{
clientep =
newIPEndPoint(IPAddress.Parse(textBox1.Text),Convert.ToI
nt32(textBox3.Text));
skt.Bind(clientep);
remoteep = newIPEndPoint(IPAddress.Parse(textBox1.Text),
Convert.ToInt32(textBox4.Text))
skt.Connect(remoteep);
byte[] b = newbyte[1500];
skt.BeginReceiveFrom(b, 0, b.Length, SocketFlags.None,
refremoteep,newAsyncCallback(mymessagecaller),b);
button2.Enabled = false;
button2.Text = "Connected";
textBox5.Focus();
}
publicvoidmymessagecaller(IAsyncResultaResult)
{
try
{
int size = skt.EndReceiveFrom(aResult, refremoteep);
if (size > 0)
{
byte[] recieveddata = newbyte[1464];
recieveddata = (byte[])aResult.AsyncState;
ASCIIEncodingeEncoding = newASCIIEncoding();
stringrecievemessage = eEncoding.GetString(recieveddata);
listBox1.Items.Add("Freind:" + recievemessage);
}
byte[] buffer = newbyte[1500];
skt.BeginReceiveFrom(buffer, 0, buffer.Length,
SocketFlags.None, refremoteep,
newAsyncCallback(mymessagecaller),buffer);
}
catch (Exception)
{
}
}
privatevoid button1_Click(object sender, EventArgs e)
{
System.Text.ASCIIEncodingenc =
newSystem.Text.ASCIIEncoding();
byte[] b = newbyte[1500];
b = enc.GetBytes(textBox5.Text);
skt.Send(b);
listBox1.Items.Add("Me:"+textBox5.Text);
textBox5.Clear();
}
}
}
BY – Kanishk Raj (CCNA)

More Related Content

What's hot

Networking Standards And Protocols
Networking Standards And ProtocolsNetworking Standards And Protocols
Networking Standards And Protocols
Steven Cahill
 
IMD 251 - Networking
IMD 251 - NetworkingIMD 251 - Networking
IMD 251 - Networking
isma ishak
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4
Raghu nath
 

What's hot (20)

Lan
LanLan
Lan
 
Osi model
Osi modelOsi model
Osi model
 
Assignment 1
Assignment 1Assignment 1
Assignment 1
 
The Basics of Computer Networking
The Basics of Computer NetworkingThe Basics of Computer Networking
The Basics of Computer Networking
 
Internet Protocols
Internet ProtocolsInternet Protocols
Internet Protocols
 
2010fall ch6 uugantsetseg
2010fall ch6 uugantsetseg2010fall ch6 uugantsetseg
2010fall ch6 uugantsetseg
 
Data communication class note 1
Data communication class note 1Data communication class note 1
Data communication class note 1
 
Tcp/Ip Model
Tcp/Ip ModelTcp/Ip Model
Tcp/Ip Model
 
Networking Standards And Protocols
Networking Standards And ProtocolsNetworking Standards And Protocols
Networking Standards And Protocols
 
Classification of Computer
Classification of ComputerClassification of Computer
Classification of Computer
 
IP & MAC Addressing
IP & MAC Addressing IP & MAC Addressing
IP & MAC Addressing
 
183492595 md.jiarul islam(CSE 318)
183492595 md.jiarul islam(CSE 318)183492595 md.jiarul islam(CSE 318)
183492595 md.jiarul islam(CSE 318)
 
2nd class
2nd class2nd class
2nd class
 
Data Communication
Data Communication Data Communication
Data Communication
 
Wireless Technology
Wireless TechnologyWireless Technology
Wireless Technology
 
Community Wireless Networks
Community Wireless NetworksCommunity Wireless Networks
Community Wireless Networks
 
Computer network assignment help
Computer network assignment helpComputer network assignment help
Computer network assignment help
 
Networking Models
Networking ModelsNetworking Models
Networking Models
 
IMD 251 - Networking
IMD 251 - NetworkingIMD 251 - Networking
IMD 251 - Networking
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4
 

Similar to Networking concept with chat server programming

Ks 5th networking_basicskevinshea
Ks 5th networking_basicskevinsheaKs 5th networking_basicskevinshea
Ks 5th networking_basicskevinshea
Prema Bahadur
 
What is networking
What is networkingWhat is networking
What is networking
babyparul
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3
Raghu nath
 
Class_notes_InternetTechnology
Class_notes_InternetTechnologyClass_notes_InternetTechnology
Class_notes_InternetTechnology
Gulrez Khan
 
Network the 4th layer
Network the 4th layerNetwork the 4th layer
Network the 4th layer
kachbourimed
 

Similar to Networking concept with chat server programming (20)

Introduction to networking
Introduction to networkingIntroduction to networking
Introduction to networking
 
Ccna introduction
Ccna introductionCcna introduction
Ccna introduction
 
Ks 5th networking_basicskevinshea
Ks 5th networking_basicskevinsheaKs 5th networking_basicskevinshea
Ks 5th networking_basicskevinshea
 
Ks 5th networking_basicskevinshea
Ks 5th networking_basicskevinsheaKs 5th networking_basicskevinshea
Ks 5th networking_basicskevinshea
 
What is networking
What is networkingWhat is networking
What is networking
 
pppppppppppppppppjjjjjjjjjjjpppppppp.pptx
pppppppppppppppppjjjjjjjjjjjpppppppp.pptxpppppppppppppppppjjjjjjjjjjjpppppppp.pptx
pppppppppppppppppjjjjjjjjjjjpppppppp.pptx
 
Concept of networking
Concept of networkingConcept of networking
Concept of networking
 
Dist 03-4
Dist 03-4Dist 03-4
Dist 03-4
 
Computer Network ASsignment
Computer Network ASsignmentComputer Network ASsignment
Computer Network ASsignment
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3
 
2.Introduction to Network Devices.ppt
2.Introduction to Network Devices.ppt2.Introduction to Network Devices.ppt
2.Introduction to Network Devices.ppt
 
Class_notes_InternetTechnology
Class_notes_InternetTechnologyClass_notes_InternetTechnology
Class_notes_InternetTechnology
 
Network the 4th layer
Network the 4th layerNetwork the 4th layer
Network the 4th layer
 
Concept of Networking and Operating System.
Concept of Networking and Operating System.Concept of Networking and Operating System.
Concept of Networking and Operating System.
 
CNP proficiency.pptx
CNP proficiency.pptxCNP proficiency.pptx
CNP proficiency.pptx
 
1658897215230.pdf
1658897215230.pdf1658897215230.pdf
1658897215230.pdf
 
Ccna report
Ccna reportCcna report
Ccna report
 
OSI model.pptx
OSI model.pptxOSI model.pptx
OSI model.pptx
 
Computer networks
Computer networksComputer networks
Computer networks
 
Cisco doc
Cisco docCisco doc
Cisco doc
 

Recently uploaded

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Recently uploaded (20)

Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

Networking concept with chat server programming

  • 1. S.NO. PROGRAM NAME REMARK 1. What is the network. 2. Overview of OSI model. 3. Define the IP & IPv4 Why IP address 4. IP header , IPv4 range 5. What is the socket , Type of socket 6. Write the socket program .
  • 2. 1. What is the networks ? A collection of two or more computers interconnected by the telephone lines, co-axial cable, satellite links, radio and microwave transmission and some other communication techniques. A computer network is a group of computers that are connected together and that communicate with one another for a common purpose. Although the computer industry is young compared to anther industries (e.g., automobiles air transportation), computer have made spectacular progress in a short time. During the first two decades of their extrinsic, computer system highly centralized, usually a single large room. A medium size company or university might have had one or two computers, while large instructions had at most a few dozen. The idea that with in 20 years equally powerful computers smaller than postage stamps would be mass produced by the millions was pure science fiction. The merging of computers & communications has had a profound influence on the way computer systems are organized. The concept of the computer center as a room with a large computer to which users bring their work for processing is now totally obsolete. The old model of single computer serving all of the organizations computational needs has been replaced by one in which a large number of separate but interconnected computers do the job. These systems are called computer networks.
  • 3.
  • 4. 1 .Overview of OSI model ? The Open Systems Interconnection model (OSI model) is a conceptual model that characterize standardizes thecommunication functions of a telecommunication or computing system without regard to their underlying internal structure and technology. Its goal is the interoperability of diverse communication systems with standard protocols. The Seven Layers of the OSI Model
  • 5.
  • 6.
  • 7.
  • 8. 2. Define the IPv4 ? Internet Protocol Characteristics  Operates at network layer of OSI  Connectionlessprotocol  Packets treated independently  Hierarchical addressing  Best-effort delivery  No data-recovery features Why IP Addresses?  They uniquelyidentify each device on an IP network.  Every host (computer, networking device, peripheral) must have a uniqueaddress.  Host ID: – Identifies the individual host – Is assigned by organizationsto individual devices
  • 9. IP PDU Header IP Address Format: Dotted Decimal Notation
  • 10. IP Address Ranges Class A addresses begin with 0xxx, or 1 to 126 decimal. Class B addresses begin with 10xx, or 128 to 191 decimal. Class C addresses begin with 110x, or 192 to 223 decimal. Class D addresses begin with 1110, or 224 to 239 decimal. Class E addresses begin with 1111, or 240 to 254 decimal. *127 (01111111) is a Class A address reserved for loopback testing and cannot be assigned to a network.
  • 11. What is the socket ? A network socket is one endpoint in a communication flow between two programs running over a network. Sockets allow communication between two different processes on the same or different machines. A Unix Socket is used in client-server application framework. A server is a process that performs some functions on request from a client. Most of the application-level protocols like FTP, SMTP, and POP3 make use of sockets to establish connection between client & server and then for exchanging data. If everything goes well, the server accepts the connection
  • 12. SocketTypes There are four types of sockets available to the users. The first two are most commonly used and the last two are rarely used.  Stream Sockets − Delivery in a networked environment is guaranteed. If you send through the stream socket three items "A, B, C", they will arrive in the same order − "A, B, C". These sockets use TCP (Transmission Control Protocol) for data transmission. If delivery is impossible, the sender receives an error indicator. Data records do not have any boundaries.  Datagram Sockets − Delivery in a networked environment is not guaranteed. They're connectionless because you don't need to have an open connection as in Stream Sockets − you build a packet with the destination information and send it out.
  • 13. Raw Sockets − These provide users access to the underlying communication protocols, which support socket abstractions. These sockets are normally datagram oriented, though their exact characteristics are dependent on the interface provided by the protocol. Raw sockets are not intended for the general user; they have been provided mainly for those interested in developing new communication protocols, or for gaining access to some of the more cryptic facilities of an existing protocol.  Sequenced Packet Sockets − They are similar to a stream socket, with the exception that record boundaries are preserved.
  • 14. WAP to implement Chat server using Socket Programming. using System; using System.Collections.Generic; usingSystem.ComponentModel; usingSystem.Data; usingSystem.Drawing; usingSystem.Linq; usingSystem.Text; usingSystem.Threading.Tasks; usingSystem.Windows.Forms; usingSystem.Net.Sockets; using System.Net; namespaceSocketProgramming { publicpartialclassForm1: Form { Socketskt; EndPointclientep, remoteep; public Form1() { InitializeComponent(); skt = newSocket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); skt.SetSocketOption(SocketOptionLevel.Socket,SocketOptio nName.ReuseAddress,true); textBox1.Text = callerip();
  • 15. textBox2.Text = callerip(); } privatestringcallerip() { IPAddress host; IPHostEntry host1; host1 = Dns.GetHostEntry(Dns.GetHostName()); foreach (IPAddressipin host1.AddressList) { if (ip.AddressFamily== AddressFamily.InterNetwork) { returnip.ToString(); } } return"172.251.1.0"; } privatevoid listBox1_SelectedIndexChanged(object sender, EventArgs e) { } privatevoid button2_Click(object sender, EventArgs e) {
  • 16. clientep = newIPEndPoint(IPAddress.Parse(textBox1.Text),Convert.ToI nt32(textBox3.Text)); skt.Bind(clientep); remoteep = newIPEndPoint(IPAddress.Parse(textBox1.Text), Convert.ToInt32(textBox4.Text)) skt.Connect(remoteep); byte[] b = newbyte[1500]; skt.BeginReceiveFrom(b, 0, b.Length, SocketFlags.None, refremoteep,newAsyncCallback(mymessagecaller),b); button2.Enabled = false; button2.Text = "Connected"; textBox5.Focus(); } publicvoidmymessagecaller(IAsyncResultaResult) { try { int size = skt.EndReceiveFrom(aResult, refremoteep); if (size > 0) { byte[] recieveddata = newbyte[1464];
  • 17. recieveddata = (byte[])aResult.AsyncState; ASCIIEncodingeEncoding = newASCIIEncoding(); stringrecievemessage = eEncoding.GetString(recieveddata); listBox1.Items.Add("Freind:" + recievemessage); } byte[] buffer = newbyte[1500]; skt.BeginReceiveFrom(buffer, 0, buffer.Length, SocketFlags.None, refremoteep, newAsyncCallback(mymessagecaller),buffer); } catch (Exception) { } } privatevoid button1_Click(object sender, EventArgs e) { System.Text.ASCIIEncodingenc = newSystem.Text.ASCIIEncoding(); byte[] b = newbyte[1500]; b = enc.GetBytes(textBox5.Text); skt.Send(b); listBox1.Items.Add("Me:"+textBox5.Text); textBox5.Clear(); } } }
  • 18. BY – Kanishk Raj (CCNA)