Not a member yet? Register for your free account!


Go Back   elitepvpers > Coders Den > General Coding > Coding Tutorials
You last visited: Today at 17:18

  • Did you know? elitepvpers has its own image host, epvpimg.com.

 

[C#] [Guide] Introduction To Asynchronous Server Sockets.

This is a discussion on [C#] [Guide] Introduction To Asynchronous Server Sockets. within the Coding Tutorials forum part of the General Coding category; Hello Guys! First i wanna to introduce myself as i am a new member here also this is my first ...

Reply
 
Thread Tools
Old 09-20-2012, 02:11   #1
ĐĂЙ
 
Danial Eugen's Avatar
 
Join Date: Sep 2012
Posts: 142
Received Thanks: 45
Blog Entries: 1
[C#] [Guide] Introduction To Asynchronous Server Sockets.


Hello Guys!

First i wanna to introduce myself as i am a new member here also this is my first tutorial at EPVP.

Quote:
My name is Danial Eugen, I am from UAE, and i am a C# programmer.


So let's begin our guide.


I. Purpose

The purpose of this tutorial is covering the following aspects

• What is the Asynchronous Calls ?.
• What is the difference between Synchronous and Asynchronous code ?.
• What is the Socket class ?.
• How to create a simple Socket Server



II. Requirements

This guide is written as a beginner guide; However, It is expected that you have a basic knowledge of C# and a working brain.

In order to be able to follow along, you will need:

• Brain.exe
• Microsoft Visual Studio 2008 or later (or equivalent)
• Will to learn



III. Explanations

I will start to explain what i was talking about previously so let's take

What is the Asynchronous Calls ?

•Simply Asynchronous(Non-Blocking) calls are made, but we don't have to wait for them to complete; therefore, the program can resume to the next function without suspending the execution .

What is the difference between Synchronous and Asynchronous code ?

•Unlike Asynchronous Calls, Synchronous(Blocking) program is executed line by line. Each time a function is called, program execution waits until that function returns before continuing to the next line of code.

So we can conclude that using an Asynchronous Call, We can prevent program freeze while doing some Time-Consuming functions.

What is the Socket class ?

•The Socket class allows you to perform both synchronous and asynchronous data transfer between clients and servers.


IV. Implementation

Now we are ready to get started. The first thing we will be doing is creating a new Console Application File->New->Project and giving it any name Ex. Asynchronous Socket Server

-Create a new class and give it a name, i will name mine Socket.cs
Spoiler:


V. Conclusion

In the end, you should have learned how to create a socket for your server development also you know what is asynchronous calls and how to use them; However, this guide is just a first step to socket programming.

NOTE :
●If you want to download the solution and test it yourself, you will find it in the attachment.
●Feel free to correct me if i failed to explain something (This is my first tutorial so i may be explained something wrong).
●Also ask any question here and i will be helping you as far as i can...

Best regards.

Danial Eugen
.
Attached Files
File Type: zip AsynchronousSocket.zip (41.3 KB, 31 views)
__________________


Last edited by Danial Eugen; 09-20-2012 at 02:16.
Danial Eugen is offline  
Thanks
7 Users
*~EliteTrader~* (09-21-2012), -PinkiWinki- (09-20-2012), chichi011 (01-04-2013), deathline4ever (09-30-2012), GodHacker (01-04-2013), Kraizy​ (09-21-2012), Robban89 (01-09-2013)
Old 09-28-2012, 00:20   #2
ĐĂЙ
 
Danial Eugen's Avatar
 
Join Date: Sep 2012
Posts: 142
Received Thanks: 45
Blog Entries: 1
Does all the effort i made in this guide deserves only 0 comments !
Danial Eugen is offline  
Thanks
1 User
chichi011 (01-04-2013)
Old 01-04-2013, 21:13   #3
C# Programmer
 
chichi011's Avatar
 
Join Date: May 2012
Posts: 534
Received Thanks: 309
It helped me, so ...
chichi011 is offline  
Reply

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Guide] Asynchronous Socket Server [For Development Purpose] Danial Eugen CO2 Programming 13 12-14-2012 20:42
C# Asynchronous Sockets vitalka SRO Coding Corner 1 10-13-2011 16:47
[Guide] Introduction to DLL Modding olykwon Mabinogi Hacks, Bots, Cheats & Exploits 7 05-03-2010 16:45
[GUIDE]EO Class Introduction Fish* Eudemons Online 0 11-05-2009 10:31




All times are GMT +2. The time now is 17:18.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.