From WikiChip
Editing mirc/sockets

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 1: Line 1:
{{mirc title|Socket Introduction}}{{Preknow|This article assumes that you have intermediate to advanced knowledge of the [[mIRC Scripting Language]] and familiarity with [[On events - mIRC|on events]] and [[Aliases - mIRC|custom aliases]].}}
+
{{Preknow|This article assumes that you have intermediate to advanced knowledge of the [[mIRC Scripting Language]] and familiarity with [[On events - mIRC|on events]] and [[Aliases - mIRC|custom aliases]].}}
'''mIRC Sockets''' are a set of {{mIRC|commands}}, {{mIRC|identifiers}}, and {{mIRC|on events|events}} that allow scripts to create network [[socket]]s. [[mIRC]] supports both {{mIRC|sockets/udp|UDP}} and {{mIRC|sockets/tcp|TCP}} sockets.
+
{{mIRC Guide}}
 +
 
 +
You have probably made it here because someone told you to "use a socket" to access this or access that. But what exactly is a socket?
  
 
== Socket ==
 
== Socket ==
Line 12: Line 14:
  
 
== IP Address ==
 
== IP Address ==
An IP address is the numerical identification that is assigned to devices that utilize the Internet Protocol like your computer's network card. Think of it as your home address for the Internet. There are two versions of the IP protocol: IPv4 and IPv6. This tutorial will cover both.  
+
An IP address is the numerical identification that is assigned to devices that utilize the Internet Protocol like your computer's network card. Think of it as your home address for the Internet. There are two version of the IP protocol: IPv4 and IPv6. This tutorial will cover both.  
  
 
A traditional IP address looks like this:
 
A traditional IP address looks like this:
Line 27: Line 29:
  
 
== Port ==
 
== Port ==
A port number is a 16-bit positive integer ranging from 0 to 65535. (2^16-1), giving you a total of 65,536 ports. Ports 1-1023 are called well known ports, ports 1024-49151 are registered ports, and ports in the range of 49152–65535 are dynamic and/or private, they cannot be registered.
+
A port number is a 16-bit positive integer ranging from 0 to 65535. (216-1), giving you a total of 65,536 ports. Ports 1-1023 are called well known ports, ports 1024-49151 are registered ports, and ports in the range of 49152–65535 are dynamic and/or private, they cannot be registered.
  
 
Be careful not to be confused between the client and server ports. The server port is the port in which the client (you) will attempt to establish a connection; the server listens to incoming connection on this port. The client port is the port at the client's end, which are an incremental number and a much higher port number.
 
Be careful not to be confused between the client and server ports. The server port is the port in which the client (you) will attempt to establish a connection; the server listens to incoming connection on this port. The client port is the port at the client's end, which are an incremental number and a much higher port number.
Line 53: Line 55:
  
 
== Stream Sockets ==
 
== Stream Sockets ==
{{main|mirc/sockets/tcp|l1=mIRC TCP Sockets}}
+
Stream sockets achieve a higher level transmission quality. Stream sockets are a connection-oriented protocol. The Transmission Control Protocol, '''TCP''', does this by making sure that your data arrives in the correct order and error-free. Most applications like mIRC itself, a telnet client, and your web browser use that protocol.
'''Stream sockets''' achieve a higher level transmission quality. Stream sockets are a connection-oriented protocol. The Transmission Control Protocol, '''TCP''', does this by making sure that your data arrives in the correct order and error-free. Most applications like mIRC itself, a telnet client, and your web browser use that protocol.
 
  
 
== Datagram Sockets ==
 
== Datagram Sockets ==
{{main|mirc/sockets/udp|l1=mIRC UDP Sockets}}
 
 
'''Datagram sockets''' on the other hand are called connectionless. You may have heard '''UDP''' or the User Datagram Protocol. The reason they are called connectionless is because they do not have to maintain an open connection as you do with stream sockets. As a consequence, data may arrive just fine, it may arrive out of order, or it might even get lost and never arrive.  
 
'''Datagram sockets''' on the other hand are called connectionless. You may have heard '''UDP''' or the User Datagram Protocol. The reason they are called connectionless is because they do not have to maintain an open connection as you do with stream sockets. As a consequence, data may arrive just fine, it may arrive out of order, or it might even get lost and never arrive.  
  
So why on earth would anyone use that you may ask? Speed, speed, and ... more speed! UDP is much faster. Your data gets the address slapped on it and gets fired away. This protocol is best suited for streaming and games where speed is the top most priority.
+
So why on earth would anyone use that you may ask? Speed, speed, and ... more speed! UDP is much faster. You data gets the address slapped on it and gets fired away. This protocol is best suited for streaming and games where speed is the top most priority.
  
 
== Summary ==
 
== Summary ==
Line 67: Line 67:
 
{| class="wikitable"
 
{| class="wikitable"
 
|+ TCP vs UDP
 
|+ TCP vs UDP
! TCP !! UDP
+
! TCP !!! UDP
 
|-
 
|-
 
| '''Goal:''' Used when reliable transport required and speed is secondary || '''Goal:''' Used when speed is required and guaranteed delivery is secondary
 
| '''Goal:''' Used when reliable transport required and speed is secondary || '''Goal:''' Used when speed is required and guaranteed delivery is secondary
Line 81: Line 81:
 
So where do you go from here? Basic on the kind of socket you are looking to work with you will have to decide whether you want [[UDP Sockets - mIRC|UDP]] or [[TCP Sockets - mIRC|TCP]].
 
So where do you go from here? Basic on the kind of socket you are looking to work with you will have to decide whether you want [[UDP Sockets - mIRC|UDP]] or [[TCP Sockets - mIRC|TCP]].
  
[[Category:mIRC|sockets]]
+
[[Category:mIRC]]

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)