Help
RSS
API
Feed
Maltego
Contact
Domain > davidlopez.es
×
Welcome!
Right click nodes and scroll the mouse to navigate the graph.
×
More information on this domain is in
AlienVault OTX
Is this malicious?
Yes
No
DNS Resolutions
Date
IP Address
2012-02-15
87.106.205.165
(
ClassC
)
2024-10-30
217.160.0.199
(
ClassC
)
Port 80
HTTP/1.1 200 OKContent-Type: text/html; charsetUTF-8Transfer-Encoding: chunkedConnection: keep-aliveKeep-Alive: timeout15Date: Wed, 30 Oct 2024 08:26:05 GMTServer: ApacheLink: https://davidlopez.es/wp-json/>; relhttps://api.w.org/ !DOCTYPE html>html langes classno-js no-svg>head>meta charsetUTF-8>meta nameviewport contentwidthdevice-width, initial-scale1>link relprofile hrefhttps://gmpg.org/xfn/11>script>(function(html){html.className html.className.replace(/\bno-js\b/,js)})(document.documentElement);/script>title>David López/title>link reldns-prefetch href//www.google.com />link reldns-prefetch href//platform.twitter.com />link reldns-prefetch href//fonts.googleapis.com />link reldns-prefetch href//s.w.org />link hrefhttps://fonts.gstatic.com crossorigin relpreconnect />link relalternate typeapplication/rss+xml titleDavid López » Feed hrefhttps://davidlopez.es/feed/ />link relalternate typeapplication/rss+xml titleDavid López » Feed de los comentarios hrefhttps://davidlopez.es/comments/feed/ /> script> window._wpemojiSettings {baseUrl:https:\/\/s.w.org\/images\/core\/emoji\/13.0.1\/72x72\/,ext:.png,svgUrl:https:\/\/s.w.org\/images\/core\/emoji\/13.0.1\/svg\/,svgExt:.svg,source:{concatemoji:http:\/\/davidlopez.es\/wp-includes\/js\/wp-emoji-release.min.js?ver5.6.14}}; !function(e,a,t){var n,r,o,ia.createElement(canvas),pi.getContext&&i.getContext(2d);function s(e,t){var aString.fromCharCode;p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,e),0,0);ei.toDataURL();return p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,t),0,0),ei.toDataURL()}function c(e){var ta.createElement(script);t.srce,t.defert.typetext/javascript,a.getElementsByTagName(head)0.appendChild(t)}for(oArray(flag,emoji),t.supports{everything:!0,everythingExceptFlag:!0},r0;ro.length;r++)t.supportsorfunction(e){if(!p||!p.fillText)return!1;switch(p.textBaselinetop,p.font600 32px Arial,e){caseflag:return s(127987,65039,8205,9895,65039,127987,65039,8203,9895,65039)?!1:!s(55356,56826,55356,56819,55356,56826,8203,55356,56819)&&!s(55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447,55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447);caseemoji:return!s(55357,56424,8205,55356,57212,55357,56424,8203,55356,57212)}return!1}(or),t.supports.everythingt.supports.everything&&t.supportsor,flag!or&&(t.supports.everythingExceptFlagt.supports.everythingExceptFlag&&t.supportsor);t.supports.everythingExceptFlagt.supports.everythingExceptFlag&&!t.supports.flag,t.DOMReady!1,t.readyCallbackfunction(){t.DOMReady!0},t.supports.everything||(nfunction(){t.readyCallback()},a.addEventListener?(a.addEventListener(DOMContentLoaded,n,!1),e.addEventListener(load,n,!1)):(e.attachEvent(onload,n),a.attachEvent(onreadystatechange,function(){completea.readyState&&t.readyCallback()})),(nt.source||{}).concatemoji?c(n.concatemoji):n.wpemoji&&n.twemoji&&(c(n.twemoji),c(n.wpemoji)))}(window,document,window._wpemojiSettings); /script> style>img.wp-smiley,img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 .07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important;}/style> link relstylesheet idwp-block-library-css hrefhttp://davidlopez.es/wp-includes/css/dist/block-library/style.min.css?ver5.6.14 mediaall />link relstylesheet idwp-block-library-theme-css hrefhttp://davidlopez.es/wp-includes/css/dist/block-library/theme.min.css?ver5.6.14 mediaall />link relstylesheet idcontact-form-7-css hrefhttp://davidlopez.es/wp-content/plugins/contact-form-7/includes/css/styles.css?ver5.3.2 mediaall />link relstylesheet idwp-syntax-css-css hrefhttp://davidlopez.es/wp-content/plugins/wp-syntax/css/wp-syntax.css?ver1.1 mediaall />link relstylesheet idtwentyseventeen-fonts-css hrefhttps://fonts.googleapis.com/css?familyLibre+Franklin%3A300%2C300i%2C400%2C400i%2C600%2C600i%2C800%2C800i&subsetlatin%2Clatin-ext&displayfallback mediaall />link relstylesheet idtwentyseventeen-style-css hrefhttp://davidlopez.es/wp-content/themes/twentyseventeen/style.css?ver20201208 mediaall />link relstylesheet idtwentyseventeen-block-style-css hrefhttp://davidlopez.es/wp-content/themes/twentyseventeen/assets/css/blocks.css?ver20190105 mediaall />!--if lt IE 9>link relstylesheet idtwentyseventeen-ie8-css hrefhttp://davidlopez.es/wp-content/themes/twentyseventeen/assets/css/ie8.css?ver20161202 mediaall />!endif-->script srchttp://davidlopez.es/wp-includes/js/jquery/jquery.min.js?ver3.5.1 idjquery-core-js>/script>script srchttp://davidlopez.es/wp-includes/js/jquery/jquery-migrate.min.js?ver3.3.2 idjquery-migrate-js>/script>!--if lt IE 9>script srchttp://davidlopez.es/wp-content/themes/twentyseventeen/assets/js/html5.js?ver20161020 idhtml5-js>/script>!endif-->link relhttps://api.w.org/ hrefhttps://davidlopez.es/wp-json/ />link relEditURI typeapplication/rsd+xml titleRSD hrefhttps://davidlopez.es/xmlrpc.php?rsd />link relwlwmanifest typeapplication/wlwmanifest+xml hrefhttp://davidlopez.es/wp-includes/wlwmanifest.xml /> meta namegenerator contentWordPress 5.6.14 />link relme hrefhttps://twitter.com/DLopez_87>meta nametwitter:widgets:link-color content#000000>meta nametwitter:widgets:border-color content#000000>meta nametwitter:partner contenttfwp>meta nametwitter:card contentsummary>meta nametwitter:title contentDavid López>meta nametwitter:site content@DLopez_87>meta nametwitter:description contentPh. D. Computer Vision> style idwp-custom-css> .grecaptcha-badge{opacity:0} /style> /head>body classblog wp-embed-responsive hfeed has-header-image has-sidebar colors-light>div idpage classsite> a classskip-link screen-reader-text href#content>Saltar al contenido/a> header idmasthead classsite-header rolebanner> div classcustom-header> div classcustom-header-media> div idwp-custom-header classwp-custom-header>img srchttp://davidlopez.es/wp-content/uploads/2019/05/cropped-5236306032_cc0d8e6a70_b.jpg width2000 height1199 altDavid López srcsethttps://davidlopez.es/wp-content/uploads/2019/05/cropped-5236306032_cc0d8e6a70_b.jpg 2000w, https://davidlopez.es/wp-content/uploads/2019/05/cropped-5236306032_cc0d8e6a70_b-300x180.jpg 300w, https://davidlopez.es/wp-content/uploads/2019/05/cropped-5236306032_cc0d8e6a70_b-768x460.jpg 768w, https://davidlopez.es/wp-content/uploads/2019/05/cropped-5236306032_cc0d8e6a70_b-1024x614.jpg 1024w sizes100vw />/div> /div> div classsite-branding> div classwrap> div classsite-branding-text> p classsite-title>a hrefhttps://davidlopez.es/ relhome>David López/a>/p> p classsite-description>Ph. D. Computer Vision/p> /div>!-- .site-branding-text --> /div>!-- .wrap -->/div>!-- .site-branding -->/div>!-- .custom-header --> div classnavigation-top> div classwrap> nav idsite-navigation classmain-navigation rolenavigation aria-labelMenú superior> button classmenu-toggle aria-controlstop-menu aria-expandedfalse> svg classicon icon-bars aria-hiddentrue roleimg> use href#icon-bars xlink:href#icon-bars>/use> /svg>svg classicon icon-close aria-hiddentrue roleimg> use href#icon-close xlink:href#icon-close>/use> /svg>Menú /button> div classmenu-principal-container>ul idtop-menu classmenu>li idmenu-item-43 classmenu-item menu-item-type-post_type menu-item-object-page menu-item-43>a hrefhttps://davidlopez.es/sobre-mi/>Sobre mí/a>/li>li idmenu-item-37 classmenu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-37>a>Producción científicasvg classicon icon-angle-down aria-hiddentrue roleimg> use href#icon-angle-down xlink:href#icon-angle-down>/use> /svg>/a>ul classsub-menu> li idmenu-item-28 classmenu-item menu-item-type-post_type menu-item-object-page menu-item-28>a hrefhttps://davidlopez.es/conferencias-internacionales/>Conferencias internacionales/a>/li> li idmenu-item-27 classmenu-item menu-item-type-post_type menu-item-object-page menu-item-27>a hrefhttps://davidlopez.es/publicaciones/>Publicaciones en revistas JCR/a>/li> li idmenu-item-40 classmenu-item menu-item-type-post_type menu-item-object-page menu-item-40>a hrefhttps://davidlopez.es/datasets/>Bases de datos/a>/li> li idmenu-item-231 classmenu-item menu-item-type-post_type menu-item-object-page menu-item-231>a hrefhttps://davidlopez.es/tesis-doctoral/>Tesis doctoral/a>/li>/ul>/li>li idmenu-item-162 classmenu-item menu-item-type-post_type menu-item-object-page menu-item-162>a hrefhttps://davidlopez.es/proyectos/>Proyectos/a>/li>li idmenu-item-50 classmenu-item menu-item-type-post_type menu-item-object-page menu-item-50>a hrefhttps://davidlopez.es/contacto/>Contacto/a>/li>/ul>/div> /nav>!-- #site-navigation --> /div>!-- .wrap --> /div>!-- .navigation-top --> /header>!-- #masthead --> div classsite-content-contain> div idcontent classsite-content>div classwrap> header classpage-header> h1 classpage-title>/h1> /header> div idprimary classcontent-area> main idmain classsite-main rolemain> article idpost-200 classpost-200 post type-post status-publish format-standard has-post-thumbnail hentry category-internet tag-corba tag-orb> header classentry-header> div classentry-meta>span classscreen-reader-text>Publicado el/span> a hrefhttps://davidlopez.es/instalacion-de-omniorb-sobre-ubuntu-14-04/ relbookmark>time classentry-date published datetime2016-04-22T19:17:02+00:00>22 abril, 2016/time>time classupdated datetime2016-04-23T12:02:39+00:00>23 abril, 2016/time>/a>/div>!-- .entry-meta -->h2 classentry-title>a hrefhttps://davidlopez.es/instalacion-de-omniorb-sobre-ubuntu-14-04/ relbookmark>Instalación de OmniORB sobre Ubuntu 14.04/a>/h2> /header>!-- .entry-header --> div classpost-thumbnail> a hrefhttps://davidlopez.es/instalacion-de-omniorb-sobre-ubuntu-14-04/> img width122 height92 srchttps://davidlopez.es/wp-content/uploads/2016/04/omniORBlogo.gif classattachment-twentyseventeen-featured-image size-twentyseventeen-featured-image wp-post-image alt loadinglazy sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px /> /a> /div>!-- .post-thumbnail --> div classentry-content> p styletext-align: justify; alignjustify>a hrefhttp://omniorb.sourceforge.net/>OmniORB/a> es un Object Request Broker (ORB) que implementa la especificación 2.6 de la Common Object Request Broker Architecture (arquitectura común de intermediarios en peticiones a objetos), más conocida como CORBA./p>p styletext-align: justify; alignjustify>Ha sido diseñado para ser portable. Corre en muchos tipos de sistemas UNIX, Windows, varios sistemas operativos embebidos, y sistemas relativamente desconocidos como OpenVMS o Fujitsu-Siemens BS2000. Ha sido diseñado para ser fácil de portar a nuevas plataformas. El mapeo de IDL a C++ es el mismo para todas las plataformas./p>p styletext-align: justify; alignjustify>OmniORB usa excepciones y clases anidadas de C++. Mantiene en lo posible la especificación estándar de CORBA y no usa mapeos alternativos para C++. Se basa en librerías nativas de hilos que proporcionan capacidad multihilo. Además, también está disponible para Python./p>p styletext-align: justify; alignjustify>Para llevar a cabo la instalación de OmniORB (Free CORBA ORB) sobre Ubuntu 14.10, es necesario realizar los siguientes pasos:/p>ul>li>Descargar a hrefhttp://sourceforge.net/projects/omniorb/files/omniORB/omniORB-4.1.5/omniORB-4.1.5.tar.bz2/download>OmniORB 4.1.5/a>/li>li>Descomprimir. Para ello, escribimos en terminal:div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #c20cb9; font-weight: bold;>tar/span> xzf omniORB-span stylecolor: #000000;>4/span>.X.X.tar.gz span stylecolor: #7a0874; font-weight: bold;>cd/span> omniORB-span stylecolor: #000000;>4/span>.X.X/pre>/td>/tr>/table>p classtheCode styledisplay:none;>tar xzf omniORB-4.X.X.tar.gz cd omniORB-4.X.X/p>/div>/li>li>Configure:div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>.span stylecolor: #000000; font-weight: bold;>//span>configure span stylecolor: #660033;>--prefix/span>span stylecolor: #000000; font-weight: bold;>//span>opt span stylecolor: #660033;>--enable-threads/span> span stylecolor: #660033;>--enable-shared/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>./configure --prefix/opt --enable-threads --enable-shared/p>/div>/li>li>Compilardiv classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #c20cb9; font-weight: bold;>make/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>make/p>/div>/li>li>Instalardiv classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #c20cb9; font-weight: bold;>make/span> span stylecolor: #c20cb9; font-weight: bold;>install/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>make install/p>/div>/li>/ul>p>Se pueden configurar algunas opciones en el momento de la instalación mediante el uso debr />algunos flags:/p>ul>ul>li>–disable-static: Compilación rápida. Algunas librerías estáticas son producidas./li>li>–enable-threads: Usa pthreads/li>li>–enable-shared: default – shared libraries generadas/li>/ul>/ul>p>Más información en a hrefhttp://omniorb.sourceforge.net/omni41/omniORB/index.html>The omniORB version 4.1 User’s Guide/a>./p>div idsgmbShare1-1 classsgmbShare jssocials-theme-minima sgmbWidget1-1>/div>div classdropdownWrapper dropdownWrapper1 dropdownWrapper-for-widget iddropdownWrapper-for-widget> div classdropdownLabel iddropdownLabel-share-list>span classsgmbButtonListLabel1>Share List/span>/div> div classdropdownPanel dropdownPanel1-1> /div> /div>script> SGMB_URL http://davidlopez.es/wp-content/plugins/social-media-builder/; jQuery(.dropdownWrapper).hide(); SGMB_GOOGLE_ACOUNT ; /script>script typetext/javascript> jQuery(document).ready(function($){var widget new SGMBWidget();widget.show({id:1,title:Share!,options:{currentUrl:1,url:,fontSize:24,theme:cloud,buttonsPosition:,socialTheme:minima,icon:cloud,buttonsPanelEffect:swing,buttonsEffect:No Effect,iconsEffect:No Effect,buttons:{\facebook\:{\label\:\Comp\\u00e1rtelo\,\icon\:\cloud-facebook\},\twitter\:{\label\:\Tweet\,\icon\:\cloud-twitter\,\via\:\\,\hashtags\:\\},\linkedin\:{\label\:\Publ\\u00edcalo\,\icon\:\cloud-linkedin\},\googleplus\:{\label\:\+1\,\icon\:\cloud-googleplus\}},roundButton:,showLabels:,showCounts:,showButtonsAsList:,setButtonsPosition:,sgmbDropdownColor:,sgmbDropdownLabelFontSize:14,sgmbDropdownLabelColor:,showButtonsOnEveryPost:,sgmbPostionOnEveryPost:Left,textOnEveryPost:,showButtonsOnMobileDirect:on},buttonOptions:{facebook:{label:Comp\u00e1rtelo,icon:cloud-facebook},twitter:{label:Tweet,icon:cloud-twitter,via:,hashtags:},linkedin:{label:Publ\u00edcalo,icon:cloud-linkedin},googleplus:{label:+1,icon:cloud-googleplus}},button:facebook,twitter,linkedin,googleplus}, 1, , https://davidlopez.es/wp-content/uploads/2016/04/omniORBlogo.gif, , https://davidlopez.es/instalacion-de-omniorb-sobre-ubuntu-14-04/); });/script> /div>!-- .entry-content --> /article>!-- #post-200 -->article idpost-186 classpost-186 post type-post status-publish format-standard has-post-thumbnail hentry category-internet tag-ftp> header classentry-header> div classentry-meta>span classscreen-reader-text>Publicado el/span> a hrefhttps://davidlopez.es/instalar-y-configurar-proftpd-en-ubuntu-14-04/ relbookmark>time classentry-date published datetime2016-04-22T17:57:09+00:00>22 abril, 2016/time>time classupdated datetime2016-04-23T12:03:36+00:00>23 abril, 2016/time>/a>/div>!-- .entry-meta -->h2 classentry-title>a hrefhttps://davidlopez.es/instalar-y-configurar-proftpd-en-ubuntu-14-04/ relbookmark>Instalar y configurar ProFTPD en Ubuntu 14.04/a>/h2> /header>!-- .entry-header --> div classpost-thumbnail> a hrefhttps://davidlopez.es/instalar-y-configurar-proftpd-en-ubuntu-14-04/> img width403 height193 srchttps://davidlopez.es/wp-content/uploads/2016/04/proftpd_logo.png classattachment-twentyseventeen-featured-image size-twentyseventeen-featured-image wp-post-image alt loadinglazy srcsethttps://davidlopez.es/wp-content/uploads/2016/04/proftpd_logo.png 403w, https://davidlopez.es/wp-content/uploads/2016/04/proftpd_logo-300x144.png 300w sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px /> /a> /div>!-- .post-thumbnail --> div classentry-content> div classentry>p styletext-align: justify;>Recientemente he necesitado instalar y configurar un servicio de FTP (File Transfer Protocol) sobre Ubuntu 14.04 Natty Narwhal. Para este propósito, he elegido ProFTPd. ProFTPd es un servidor FTP bajo licencia GPL y multiplataforma. Puede configurarse de una manera rápida y fácil. Además, soporta IPv6.Estos son los pasos a seguir para su instalación y configuración:/p>p>code>sudo apt-get install proftpd/code>/p>p>A continuación se puede seleccionar «INETD» o «Independiente». Seleccionar «Independiente». Después, abrir el fichero /etc/proftpd/proftpd.conf y descomentar la línea DefaultRoot ~ , quedando como sigue:/p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classhtml stylefont-family:monospace;># Use this to jail all users in their homesDefaultRoot ~/pre>/td>/tr>/table>p classtheCode styledisplay:none;># Use this to jail all users in their homesDefaultRoot ~/p>/div>p>Reiniciar el servicio, con sudo /etc/init.d/proftpd restart. Ahora ya puedes acceder por FTP a tu directorio HOME./p>p>Opcionalmente, podemos crear un nuevo usuario:/p>p>code>sudo mkdir /home/usuarioftp/code>/p>p>Lo añadimos al sistema/p>p>code>sudo useradd -d /home/usuarioftp -s /bin/false usuarioftp/code>/p>p>y le asignamos una carpeta:/p>p>code>sudo chown -R usuarioftp /home/usuarioftp/code>/p>p>Antes de proceder a establecer los permisos, necesitamos especificar contraseña del usuario:/p>p>code>sudo passwd usuarioftp/code>/p>p>Ahora, añadimos al final del fichero proftpd.conf el siguiente bloque para limitar el acceso por FTP solo permitiendo el usuario que hemos creado:/p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classhtml stylefont-family:monospace;>AllowUser usuarioftpDenyAll RequireValidShell off/pre>/td>/tr>/table>p classtheCode styledisplay:none;>AllowUser usuarioftpDenyAllRequireValidShell off/p>/div>p>Y para terminar reiniciamos el servicio de ProFTPd para aplicar los cambios:/p>p>code>/etc/init.d/proftpd restart/code>/p>div idsgmbShare1-2 classsgmbShare jssocials-theme-minima sgmbWidget1-2>/div>div classdropdownWrapper dropdownWrapper1 dropdownWrapper-for-widget iddropdownWrapper-for-widget> div classdropdownLabel iddropdownLabel-share-list>span classsgmbButtonListLabel1>Share List/span>/div> div classdropdownPanel dropdownPanel1-2> /div> /div>script> SGMB_URL http://davidlopez.es/wp-content/plugins/social-media-builder/; jQuery(.dropdownWrapper).hide(); SGMB_GOOGLE_ACOUNT ; /script>script typetext/javascript> jQuery(document).ready(function($){var widget new SGMBWidget();widget.show({id:1,title:Share!,options:{currentUrl:1,url:,fontSize:24,theme:cloud,buttonsPosition:,socialTheme:minima,icon:cloud,buttonsPanelEffect:swing,buttonsEffect:No Effect,iconsEffect:No Effect,buttons:{\facebook\:{\label\:\Comp\\u00e1rtelo\,\icon\:\cloud-facebook\},\twitter\:{\label\:\Tweet\,\icon\:\cloud-twitter\,\via\:\\,\hashtags\:\\},\linkedin\:{\label\:\Publ\\u00edcalo\,\icon\:\cloud-linkedin\},\googleplus\:{\label\:\+1\,\icon\:\cloud-googleplus\}},roundButton:,showLabels:,showCounts:,showButtonsAsList:,setButtonsPosition:,sgmbDropdownColor:,sgmbDropdownLabelFontSize:14,sgmbDropdownLabelColor:,showButtonsOnEveryPost:,sgmbPostionOnEveryPost:Left,textOnEveryPost:,showButtonsOnMobileDirect:on},buttonOptions:{facebook:{label:Comp\u00e1rtelo,icon:cloud-facebook},twitter:{label:Tweet,icon:cloud-twitter,via:,hashtags:},linkedin:{label:Publ\u00edcalo,icon:cloud-linkedin},googleplus:{label:+1,icon:cloud-googleplus}},button:facebook,twitter,linkedin,googleplus}, 2, , https://davidlopez.es/wp-content/uploads/2016/04/proftpd_logo.png, , https://davidlopez.es/instalar-y-configurar-proftpd-en-ubuntu-14-04/); });/script>/div> /div>!-- .entry-content --> /article>!-- #post-186 -->article idpost-177 classpost-177 post type-post status-publish format-standard has-post-thumbnail hentry category-sin-categoria> header classentry-header> div classentry-meta>span classscreen-reader-text>Publicado el/span> a hrefhttps://davidlopez.es/suma-concurrente-de-vectores-con-nvidia-cuda/ relbookmark>time classentry-date published datetime2016-04-22T13:59:30+00:00>22 abril, 2016/time>time classupdated datetime2016-04-23T12:04:04+00:00>23 abril, 2016/time>/a>/div>!-- .entry-meta -->h2 classentry-title>a hrefhttps://davidlopez.es/suma-concurrente-de-vectores-con-nvidia-cuda/ relbookmark>Suma concurrente de vectores con NVidia CUDA/a>/h2> /header>!-- .entry-header --> div classpost-thumbnail> a hrefhttps://davidlopez.es/suma-concurrente-de-vectores-con-nvidia-cuda/> img width294 height171 srchttps://davidlopez.es/wp-content/uploads/2016/04/images.png classattachment-twentyseventeen-featured-image size-twentyseventeen-featured-image wp-post-image alt loadinglazy sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px /> /a> /div>!-- .post-thumbnail --> div classentry-content> p styletext-align: justify;>CUDA es una arquitectura hardware y software para la computación en la GPU. Consiste en utilizar el procesador gráfico o GPU como coprocesador junto con la CPU./p>p styletext-align: justify;>La GPU es un procesador especializado cuyas capacidades de cómputo se resumen en lo siguiente:/p>ul styletext-align: justify;>li>Múltiples núcleos dirigidos por un gran ancho de banda de memoria./li>li>Gran paralelismo./li>li>Optimización para cálculos en coma flotante./li>li>Bajo coste./li>li>Ingente cantidad de transistores.ul>li>Procesamiento de datos./li>li>Almacenamiento en caché./li>li>Control del flujo./li>/ul>/li>/ul>p styletext-align: justify;>Estos son generalmente los pasos de cualquier aplicación CUDA:/p>ol styletext-align: justify;>li>Copiar los datos a procesar desde la memoria de la CPU a la memoria de la GPU./li>li>Invocar el Kernel en la GPU./li>li>El Kernel ejecuta iteraciones del bucle en paralelo en cada núcleo./li>li>Copiar el resultado desde la memoria de la GPU a la memoria de la CPU./li>/ol>p styletext-align: justify;>El siguiente programa utiliza esta arquitectura para realizar de forma concurrente la suma de dos vectores a y b, y almacenar el resultado en un tercer vector c. Cabe destacar que este es el ejemplo b>más sencillo/b> que se puede encontrar del uso de CUDA./p>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071/pre>/td>td classcode>pre classcpp stylefont-family:monospace;>span stylecolor: #339900;>#include /span>span stylecolor: #339900;>#include /span>span stylecolor: #339900;>#include /span> span stylecolor: #0000ff;>using/span> span stylecolor: #0000ff;>namespace/span> stdspan stylecolor: #008080;>;/span> span stylecolor: #339900;>#define TAM 8 // Tamanho del vector/span> span stylecolor: #666666;>// Declaración del kernel/span>__global__ span stylecolor: #0000ff;>void/span> kernelSumaspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #000040;>*/span> a, span stylecolor: #0000ff;>int/span>span stylecolor: #000040;>*/span> b, span stylecolor: #0000ff;>int/span>span stylecolor: #000040;>*/span> cspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> mainspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span> argc, span stylecolor: #0000ff;>char/span> span stylecolor: #000040;>*/span>argvspan stylecolor: #008000;>[/span>span stylecolor: #008000;>]/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>int/span> span stylecolor: #000040;>*/span>a_h, span stylecolor: #000040;>*/span>b_h, span stylecolor: #000040;>*/span>c_hspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> span stylecolor: #000040;>*/span>a_d, span stylecolor: #000040;>*/span>b_d, span stylecolor: #000040;>*/span>c_dspan stylecolor: #008080;>;/span> span stylecolor: #666666;>// Reservamos memoria para los vectores host/span> a_h span stylecolor: #000080;>/span> span stylecolor: #0000dd;>new/span> span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>[/span>TAMspan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> b_h span stylecolor: #000080;>/span> span stylecolor: #0000dd;>new/span> span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>[/span>TAMspan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> c_h span stylecolor: #000080;>/span> span stylecolor: #0000dd;>new/span> span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>[/span>TAMspan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// Reservamos memoria en la GPU/span> cudaMallocspan stylecolor: #008000;>(/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span> span stylecolor: #000040;>**/span>span stylecolor: #008000;>)/span>span stylecolor: #000040;>&/span>a_d, TAMspan stylecolor: #000040;>*/span>span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> cudaMallocspan stylecolor: #008000;>(/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span> span stylecolor: #000040;>**/span>span stylecolor: #008000;>)/span>span stylecolor: #000040;>&/span>b_d, TAMspan stylecolor: #000040;>*/span>span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> cudaMallocspan stylecolor: #008000;>(/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span> span stylecolor: #000040;>**/span>span stylecolor: #008000;>)/span>span stylecolor: #000040;>&/span>c_d, TAMspan stylecolor: #000040;>*/span>span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// Se configura un tamanio de bloque de 4 hilos/span> span stylecolor: #0000ff;>int/span> tamanio_bloque span stylecolor: #000080;>/span> span stylecolor: #0000dd;>4/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> num_bloques span stylecolor: #000080;>/span> TAMspan stylecolor: #000040;>//span>tamanio_bloque span stylecolor: #000040;>+/span> span stylecolor: #008000;>(/span>TAMspan stylecolor: #000040;>%/span>tamanio_bloque span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span> span stylecolor: #008080;>?/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>:/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// Inicialización de los vectores en memoria host/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span> ispan stylecolor: #000080;>/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span>ispan stylecolor: #000080;></span>TAMspan stylecolor: #008080;>;/span>ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> a_hspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span> span stylecolor: #000080;>/span> ispan stylecolor: #008080;>;/span> b_hspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span> span stylecolor: #000080;>/span> ispan stylecolor: #000040;>*/span>span stylecolor: #0000dd;>2/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #666666;>// Copiamos los datos desde la memoria host a la memoria device/span> cudaMemcpyspan stylecolor: #008000;>(/span>a_d, a_h, TAMspan stylecolor: #000040;>*/span>span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>)/span>, cudaMemcpyHostToDevicespan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> cudaMemcpyspan stylecolor: #008000;>(/span>b_d, b_h, TAMspan stylecolor: #000040;>*/span>span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>)/span>, cudaMemcpyHostToDevicespan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> kernelSumaspan stylecolor: #000080;><<</span>tamanio_bloque, num_bloquesspan stylecolor: #000080;>>>>/span>span stylecolor: #008000;>(/span>a_d, b_d, c_dspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// Copia los resultados del vector c desde la memoria de la GPU/span> span stylecolor: #666666;>// a la memoria del host/span> cudaMemcpyspan stylecolor: #008000;>(/span>c_h, c_d, TAMspan stylecolor: #000040;>*/span>span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>)/span>, cudaMemcpyDeviceToHostspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// Imprime los resultados/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span> i span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> i span stylecolor: #000080;></span> TAMspan stylecolor: #008080;>;/span> ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span> span stylecolor: #0000dd;>cout/span> span stylecolor: #000080;><</span> c_hspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span> span stylecolor: #000080;><</span> span stylecolor: #FF0000;>" "/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>cout/span> span stylecolor: #000080;><</span> endlspan stylecolor: #008080;>;/span> span stylecolor: #666666;>// Libera la memoria/span> span stylecolor: #666666;>// Tanto en el host.../span> span stylecolor: #0000dd;>free/span>span stylecolor: #008000;>(/span>a_hspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>free/span>span stylecolor: #008000;>(/span>b_hspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>free/span>span stylecolor: #008000;>(/span>c_hspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// ...como en la device./span> cudaFreespan stylecolor: #008000;>(/span>a_dspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> cudaFreespan stylecolor: #008000;>(/span>b_dspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> cudaFreespan stylecolor: #008000;>(/span>c_dspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #666666;>// Definición del kernel/span>__global__ span stylecolor: #0000ff;>void/span> kernelSumaspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span> span stylecolor: #000040;>*/span>a, span stylecolor: #0000ff;>int/span> span stylecolor: #000040;>*/span>b, span stylecolor: #0000ff;>int/span> span stylecolor: #000040;>*/span>cspan stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #666666;>// i Número de bloque * dimensión del bloque + hilo dentro del bloque/span> span stylecolor: #0000ff;>int/span> i span stylecolor: #000080;>/span> blockIdx.span stylecolor: #007788;>x/span> span stylecolor: #000040;>*/span> blockDim.span stylecolor: #007788;>x/span> span stylecolor: #000040;>+/span> threadIdx.span stylecolor: #007788;>x/span>span stylecolor: #008080;>;/span> cspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span> span stylecolor: #000080;>/span> aspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>span stylecolor: #000040;>+/span>bspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span>span stylecolor: #008000;>}/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>#include #include #include using namespace std;#define TAM 8 // Tamanho del vector// Declaración del kernel__global__ void kernelSuma(int* a, int* b, int* c);int main(int argc, char *argv) { int *a_h, *b_h, *c_h; int *a_d, *b_d, *c_d; // Reservamos memoria para los vectores host a_h new intTAM; b_h new intTAM; c_h new intTAM; // Reservamos memoria en la GPU cudaMalloc((void **)&a_d, TAM*sizeof(int)); cudaMalloc((void **)&b_d, TAM*sizeof(int)); cudaMalloc((void **)&c_d, TAM*sizeof(int)); // Se configura un tamanio de bloque de 4 hilos int tamanio_bloque 4; int num_bloques TAM/tamanio_bloque + (TAM%tamanio_bloque 0 ? 0:1); // Inicialización de los vectores en memoria host for(int i0;i<TAM;i++) { a_hi i; b_hi i*2; } // Copiamos los datos desde la memoria host a la memoria device cudaMemcpy(a_d, a_h, TAM*sizeof(int), cudaMemcpyHostToDevice); cudaMemcpy(b_d, b_h, TAM*sizeof(int), cudaMemcpyHostToDevice); kernelSuma<<<tamanio_bloque, num_bloques>>>(a_d, b_d, c_d); // Copia los resultados del vector c desde la memoria de la GPU // a la memoria del host cudaMemcpy(c_h, c_d, TAM*sizeof(int), cudaMemcpyDeviceToHost); // Imprime los resultados for(int i 0; i < TAM; i++) cout << c_hi << " "; cout << endl; // Libera la memoria // Tanto en el host... free(a_h); free(b_h); free(c_h); // ...como en la device. cudaFree(a_d); cudaFree(b_d); cudaFree(c_d);} // Definición del kernel__global__ void kernelSuma(int *a, int *b, int *c) { // i Número de bloque * dimensión del bloque + hilo dentro del bloque int i blockIdx.x * blockDim.x + threadIdx.x; ci ai+bi;}/p>/div>div idsgmbShare1-3 classsgmbShare jssocials-theme-minima sgmbWidget1-3>/div>div classdropdownWrapper dropdownWrapper1 dropdownWrapper-for-widget iddropdownWrapper-for-widget> div classdropdownLabel iddropdownLabel-share-list>span classsgmbButtonListLabel1>Share List/span>/div> div classdropdownPanel dropdownPanel1-3> /div> /div>script> SGMB_URL http://davidlopez.es/wp-content/plugins/social-media-builder/; jQuery(.dropdownWrapper).hide(); SGMB_GOOGLE_ACOUNT ; /script>script typetext/javascript> jQuery(document).ready(function($){var widget new SGMBWidget();widget.show({id:1,title:Share!,options:{currentUrl:1,url:,fontSize:24,theme:cloud,buttonsPosition:,socialTheme:minima,icon:cloud,buttonsPanelEffect:swing,buttonsEffect:No Effect,iconsEffect:No Effect,buttons:{\facebook\:{\label\:\Comp\\u00e1rtelo\,\icon\:\cloud-facebook\},\twitter\:{\label\:\Tweet\,\icon\:\cloud-twitter\,\via\:\\,\hashtags\:\\},\linkedin\:{\label\:\Publ\\u00edcalo\,\icon\:\cloud-linkedin\},\googleplus\:{\label\:\+1\,\icon\:\cloud-googleplus\}},roundButton:,showLabels:,showCounts:,showButtonsAsList:,setButtonsPosition:,sgmbDropdownColor:,sgmbDropdownLabelFontSize:14,sgmbDropdownLabelColor:,showButtonsOnEveryPost:,sgmbPostionOnEveryPost:Left,textOnEveryPost:,showButtonsOnMobileDirect:on},buttonOptions:{facebook:{label:Comp\u00e1rtelo,icon:cloud-facebook},twitter:{label:Tweet,icon:cloud-twitter,via:,hashtags:},linkedin:{label:Publ\u00edcalo,icon:cloud-linkedin},googleplus:{label:+1,icon:cloud-googleplus}},button:facebook,twitter,linkedin,googleplus}, 3, , https://davidlopez.es/wp-content/uploads/2016/04/images.png, , https://davidlopez.es/suma-concurrente-de-vectores-con-nvidia-cuda/); });/script> /div>!-- .entry-content --> /article>!-- #post-177 -->article idpost-169 classpost-169 post type-post status-publish format-standard has-post-thumbnail hentry category-internet category-programacion> header classentry-header> div classentry-meta>span classscreen-reader-text>Publicado el/span> a hrefhttps://davidlopez.es/chat-multihilo-con-sockets-en-python-y-en-c/ relbookmark>time classentry-date published datetime2016-04-20T14:07:34+00:00>20 abril, 2016/time>time classupdated datetime2016-04-24T23:31:54+00:00>24 abril, 2016/time>/a>/div>!-- .entry-meta -->h2 classentry-title>a hrefhttps://davidlopez.es/chat-multihilo-con-sockets-en-python-y-en-c/ relbookmark>Chat multihilo con Sockets en Python y en C/a>/h2> /header>!-- .entry-header --> div classpost-thumbnail> a hrefhttps://davidlopez.es/chat-multihilo-con-sockets-en-python-y-en-c/> img width981 height599 srchttps://davidlopez.es/wp-content/uploads/2016/04/chatgrafico.png classattachment-twentyseventeen-featured-image size-twentyseventeen-featured-image wp-post-image alt loadinglazy srcsethttps://davidlopez.es/wp-content/uploads/2016/04/chatgrafico.png 981w, https://davidlopez.es/wp-content/uploads/2016/04/chatgrafico-300x183.png 300w, https://davidlopez.es/wp-content/uploads/2016/04/chatgrafico-768x469.png 768w sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px /> /a> /div>!-- .post-thumbnail --> div classentry-content> p alignjustify>La b>computación concurrente/b> es la capacidad de simultanear en la ejecución de múltiples tareas interactivas. Un proceso es un programa en ejecución, que es gestionado por el Sistema Operativo y compite por los recursos del procesador. Los procesos tienen estado y memoria en ejecución reservada. El mecanismo por el cual un proceso crea otro proceso se denomina bifurcación (fork). Cuando un proceso se bifurca, se crea una copia exacta del proceso en ejecución, independiente del resto y no comparte el espacio de memoria con el proceso que los ha creado ni con otros procesos./p>p alignjustify>Un b>hilo/b>, en sistemas operativos, es una característica que permite a una aplicación realizar varias tareas a la vez (concurrentemente). Los distintos hilos de ejecución comparten una serie de recursos tales como el espacio de memoria, o los archivos abiertos. Esta técnica permite simplificar el diseño de una aplicación que debe llevar a cabo distintas funciones simultáneamente. Un hilo es un tarea que se ejecuta en paralelo con otra tarea./p>p alignjustify>La comunicación entre el cliente y el servidor se hace posible gracias a estructuras abstractas denominadas b>sockets/b>, mediante las cuales los programas pueden intercambiar flujo de datos e información. Este concepto está asociado al concepto de puerto./p>p alignjustify>Un puerto es una forma genérica de denominar a una interfaz a través de la cual los diferentes tipos de datos se pueden enviar y recibir. En el protocolo TCP/IP, son de tipo lógico, por ejemplo, los puertos que permiten la transmisión de datos entre diferentes computadores./p>p alignjustify>Existen dos tipos de sockets, orientados a conexión y no orientados a conexión. La diferencia fundamental es que en los sockets orientados a conexión (TCP) el protocolo garantiza que los datos serán entregados en su destino sin errores y en el mismo orden en que se transmitieron, mientras que en los sockets no orientados a conexión (o UDP) no se garantiza que el mensaje llegue a su destino. Parece claro que si el programa envía un mensaje y no hay nadie escuchando, ese mensaje se pierde. De todas formas, aunque haya alguien escuchando, el protocolo tampoco garantiza que el mensaje llegue. Lo único que garantiza es, que si llega, llega sin errores./p>p alignjustify>En una b>comunicación con sockets multihilo/b>, como es el caso de la implementación que nos ocupa, cada conexión es gestionada por un proceso o hilo de ejecución independiente. Así, con cada cliente que conecte con el servidor, se expande un nuevo hilo del lado del servidor, que gestionará las peticiones del cliente asociado a él. Servidores concurrentes pueden ser multiproceso o multihilo. Estos son utilizados para servicios largos con mucha sincronización Cliente-Servidor./p>p alignjustify>A continuación dejo el código de ambas implementaciones, primero en C++ y después en Python./p>h3>Comandos/h3>ul>li>b>ADD usuario/b>:Introduce un usuario en el chat./li>li>b>LIST/b>: Obtiene la lista de clientes conectados./li>li>b>END/b>: Desconecta y sale de la sesión./li>li>b>TEXT/b>: Envía un mensaje a todos los usuarios conectados./li>li>b>TEXT TO usuario/b>: Envía un mensaje privado a un usuario./li>/ul>h4>En C++/h4>h5>Servidor/h5>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180/pre>/td>td classcode>pre classcpp stylefont-family:monospace;>span stylecolor: #339900;>#include <stdio.h>/span>span stylecolor: #339900;>#include <string.h>/span>span stylecolor: #339900;>#include <sys/types.h>/span>span stylecolor: #339900;>#include <unistd.h>/span>span stylecolor: #339900;>#include <stdlib.h>/span>span stylecolor: #339900;>#include <sys/types.h>/span>span stylecolor: #339900;>#include <sys/socket.h>/span>span stylecolor: #339900;>#include <netinet/in.h>/span>span stylecolor: #339900;>#include <arpa/inet.h>/span>span stylecolor: #339900;>#include <pthread.h>/span> span stylecolor: #339900;>#define SERVER_PORT 6543/span>span stylecolor: #339900;>#define SERVER_ADDRESS "127.0.0.1"/span>span stylecolor: #339900;>#define MAXLINE 512/span>span stylecolor: #339900;>#define MAXCLIENTS 10/span> span stylecolor: #0000ff;>int/span> buscarClientespan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>char/span>span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span>span stylecolor: #0000ff;>void/span> subCadenaspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>char/span>span stylecolor: #000040;>*/span>, span stylecolor: #0000ff;>char/span>span stylecolor: #000040;>*/span>, span stylecolor: #0000ff;>int/span>, span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>struct/span> vectorspan stylecolor: #008000;>{/span> span stylecolor: #0000ff;>int/span> socketspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>char/span> usuariospan stylecolor: #008000;>[/span>MAXLINEspan stylecolor: #000040;>-/span>span stylecolor: #0000dd;>4/span>span stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> sign_inspan stylecolor: #008080;>;/span>span stylecolor: #008000;>}/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>struct/span> vector vectorClientesspan stylecolor: #008000;>[/span>MAXCLIENTSspan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span>span stylecolor: #0000ff;>int/span> clientes span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> mainspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span> argc, span stylecolor: #0000ff;>char/span> span stylecolor: #000040;>*/span>argvspan stylecolor: #008000;>[/span>span stylecolor: #008000;>]/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> gestionaClientespan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> pspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> socketfd, new_sdspan stylecolor: #008080;>;/span> socklen_t client_lenspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>struct/span> sockaddr_in server_addr, client_addrspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> i, status, idspan stylecolor: #008080;>;/span> pthread_t hilosspan stylecolor: #008000;>[/span>MAXCLIENTSspan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>ispan stylecolor: #000080;>/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span>ispan stylecolor: #000080;></span>MAXCLIENTSspan stylecolor: #008080;>;/span>ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span> span stylecolor: #0000dd;>strcpy/span>span stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>usuario/span>, span stylecolor: #FF0000;>" "/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// Open TCP internet STREAM socket/span> span stylecolor: #0000ff;>if/span> span stylecolor: #008000;>(/span>span stylecolor: #008000;>(/span>socketfd span stylecolor: #000080;>/span> socketspan stylecolor: #008000;>(/span>AF_INET, SOCK_STREAM, span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span> span stylecolor: #000080;></span> span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span> span stylecolor: #0000dd;>perror/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"server: Cant open stream socket"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// Bind local address to allow the client to connect/span> bzerospan stylecolor: #008000;>(/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>char/span> span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&/span>server_addr, span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>server_addrspan stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> server_addr.span stylecolor: #007788;>sin_family/span> span stylecolor: #000080;>/span> AF_INETspan stylecolor: #008080;>;/span> server_addr.span stylecolor: #007788;>sin_addr/span>.span stylecolor: #007788;>s_addr/span> span stylecolor: #000080;>/span> htonlspan stylecolor: #008000;>(/span>INADDR_ANYspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> server_addr.span stylecolor: #007788;>sin_port/span> span stylecolor: #000080;>/span> htonsspan stylecolor: #008000;>(/span>SERVER_PORTspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>if/span> span stylecolor: #008000;>(/span>bind span stylecolor: #008000;>(/span>socketfd, span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>struct/span> sockaddr span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&/span>server_addr, span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>server_addrspan stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span> span stylecolor: #000080;></span> span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span> span stylecolor: #0000dd;>perror/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"server: cant bind local address"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> listenspan stylecolor: #008000;>(/span>socketfd, span stylecolor: #0000dd;>5/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>for/span> span stylecolor: #008000;>(/span>span stylecolor: #008080;>;;/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> client_len span stylecolor: #000080;>/span> span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>client_addrspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>span stylecolor: #008000;>(/span>new_sd span stylecolor: #000080;>/span> acceptspan stylecolor: #008000;>(/span>socketfd, span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>struct/span> sockaddr span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&/span>client_addr, span stylecolor: #000040;>&/span>client_lenspan stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span> span stylecolor: #000080;></span> span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"Error aceptando peticionesspan stylecolor: #000099; font-weight: bold;>\n/span>"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>exit/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>else/span> span stylecolor: #008000;>{/span> id span stylecolor: #000080;>/span> clientesspan stylecolor: #008080;>;/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>socket/span> span stylecolor: #000080;>/span> new_sdspan stylecolor: #008080;>;/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>fflush/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>stdout/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> clientesspan stylecolor: #000040;>++/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>if/span> span stylecolor: #008000;>(/span> span stylecolor: #008000;>(/span>status span stylecolor: #000080;>/span> pthread_createspan stylecolor: #008000;>(/span>span stylecolor: #000040;>&/span>hilosspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>,span stylecolor: #0000ff;>NULL/span>,gestionaCliente,span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span> span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span>span stylecolor: #000040;>&/span>idspan stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"Error al crear el hilospan stylecolor: #000099; font-weight: bold;>\n/span>"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>exit/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #008000;>}/span> span stylecolor: #008000;>}/span> closespan stylecolor: #008000;>(/span>socketfdspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// Close original socket/span> span stylecolor: #0000ff;>return/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span>span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>void/span> subCadenaspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>char/span> span stylecolor: #000040;>*/span>subCad, span stylecolor: #0000ff;>char/span> span stylecolor: #000040;>*/span>cad, span stylecolor: #0000ff;>int/span> inicio, span stylecolor: #0000ff;>int/span> cuantosspan stylecolor: #008000;>)/span>span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>int/span> i,jspan stylecolor: #000080;>/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>ispan stylecolor: #000080;>/span>iniciospan stylecolor: #008080;>;/span>ispan stylecolor: #000080;></span>iniciospan stylecolor: #000040;>+/span>cuantos span stylecolor: #000040;>&&/span> cadspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>span stylecolor: #000040;>!/span>span stylecolor: #000080;>/span>span stylecolor: #FF0000;>span stylecolor: #006699; font-weight: bold;>\0/span>/span>span stylecolor: #008080;>;/span>ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> subCadspan stylecolor: #008000;>[/span>jspan stylecolor: #008000;>]/span>span stylecolor: #000080;>/span>cadspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> jspan stylecolor: #000040;>++/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> subCadspan stylecolor: #008000;>[/span>jspan stylecolor: #008000;>]/span>span stylecolor: #000080;>/span>span stylecolor: #FF0000;>span stylecolor: #006699; font-weight: bold;>\0/span>/span>span stylecolor: #008080;>;/span>span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>int/span> buscarClientespan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>char/span>span stylecolor: #000040;>*/span> usuariospan stylecolor: #008000;>)/span>span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>int/span> ispan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>ispan stylecolor: #000080;>/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span>ispan stylecolor: #000080;></span>clientesspan stylecolor: #008080;>;/span>ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>strcmp/span>span stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>usuario/span>,usuario span stylecolor: #008000;>)/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span> span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #0000ff;>return/span> vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>socket/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>return/span> span stylecolor: #000040;>-/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008080;>;/span>span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> gestionaClientespan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> pspan stylecolor: #008000;>)/span>span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>int/span> span stylecolor: #000040;>*/span>ide, idspan stylecolor: #008080;>;/span> ide span stylecolor: #000080;>/span> span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #000040;>*/span> span stylecolor: #008000;>)/span> pspan stylecolor: #008080;>;/span> id span stylecolor: #000080;>/span> span stylecolor: #000040;>*/span>idespan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>char/span> bufferspan stylecolor: #008000;>[/span>MAXLINEspan stylecolor: #008000;>]/span>, nombrespan stylecolor: #008000;>[/span>MAXLINEspan stylecolor: #000040;>-/span>span stylecolor: #0000dd;>4/span>span stylecolor: #008000;>]/span>, tempspan stylecolor: #008000;>[/span>MAXLINEspan stylecolor: #000040;>-/span>span stylecolor: #0000dd;>8/span>span stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> i, longitud, destinospan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>while/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> recvspan stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>socket/span>,buffer,MAXLINE,span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"span stylecolor: #000099; font-weight: bold;>\n/span>id%dspan stylecolor: #000099; font-weight: bold;>\n/span>"/span>, idspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>strstr/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>"ADD"/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> longitud span stylecolor: #000080;>/span> span stylecolor: #0000dd;>strlen/span>span stylecolor: #008000;>(/span>bufferspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>//Le quitamos el ADD/span> subCadenaspan stylecolor: #008000;>(/span>nombre, buffer, span stylecolor: #0000dd;>4/span>, longitudspan stylecolor: #000040;>-/span>span stylecolor: #0000dd;>4/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcpy/span>span stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>usuario/span>, nombrespan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>//Se informa a todos menos a él mismo y al que se haya ido/span> span stylecolor: #0000dd;>strcpy/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>"El usuario "/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>buffer, nombrespan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>" ha entrado en el chat."/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>i span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> i span stylecolor: #000080;></span> clientesspan stylecolor: #008080;>;/span> ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span> span stylecolor: #0000ff;>if/span> span stylecolor: #008000;>(/span>i span stylecolor: #000040;>!/span>span stylecolor: #000080;>/span> id span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> sendspan stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>socket/span>,buffer,MAXLINE,span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>strstr/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>"LIST"/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #666666;>//Se envia al cliente todos los usuarios menos los que hayan abandonado la sesión/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>i span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> i span stylecolor: #000080;></span> clientesspan stylecolor: #008080;>;/span> ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> sendspan stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>socket/span>, vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>usuario/span>, MAXLINE, span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>strstr/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>"END"/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #666666;>//Se informa a todos menos a él mismo y al que se haya ido/span> span stylecolor: #0000dd;>strcpy/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>"El usuario "/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>buffer, vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>usuario/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>" ha abandonado en el chat."/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> bzerospan stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>usuario/span>, MAXLINEspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>i span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> i span stylecolor: #000080;></span> clientesspan stylecolor: #008080;>;/span> ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span> span stylecolor: #0000ff;>if/span> span stylecolor: #008000;>(/span>i span stylecolor: #000040;>!/span>span stylecolor: #000080;>/span> id span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> sendspan stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>socket/span>,buffer,MAXLINE,span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>strstr/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>"TEXT"/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&&/span> span stylecolor: #000040;>!/span>span stylecolor: #0000dd;>strstr/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>"TEXT TO"/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> longitud span stylecolor: #000080;>/span> span stylecolor: #0000dd;>strlen/span>span stylecolor: #008000;>(/span>bufferspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> subCadenaspan stylecolor: #008000;>(/span>temp, buffer, span stylecolor: #0000dd;>5/span>, longitudspan stylecolor: #000040;>-/span>span stylecolor: #0000dd;>5/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>//Se envía a todos menos a él mismo y al que se haya ido/span> bzerospan stylecolor: #008000;>(/span>buffer, MAXLINEspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>buffer, vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>usuario/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>" dice: "/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>buffer, tempspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>i span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> i span stylecolor: #000080;></span> clientesspan stylecolor: #008080;>;/span> ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span> span stylecolor: #0000ff;>if/span> span stylecolor: #008000;>(/span>i span stylecolor: #000040;>!/span>span stylecolor: #000080;>/span> id span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> sendspan stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>socket/span>,buffer,MAXLINE,span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>strstr/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>"TEXT TO"/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #666666;>//Le quitamos el TEXT TO/span> subCadenaspan stylecolor: #008000;>(/span>nombre, buffer, span stylecolor: #0000dd;>8/span>, MAXLINEspan stylecolor: #000040;>-/span>span stylecolor: #0000dd;>8/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>//Nos quedamos sólo con el nombre, quitando desde el primer espacio en blanco hasta el final/span> span stylecolor: #0000dd;>strtok/span>span stylecolor: #008000;>(/span>nombre,span stylecolor: #FF0000;>" "/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>//Se obtiene el socket destino/span> destino span stylecolor: #000080;>/span> buscarClientespan stylecolor: #008000;>(/span>nombrespan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> longitudspan stylecolor: #000080;>/span>span stylecolor: #0000dd;>strlen/span>span stylecolor: #008000;>(/span>nombrespan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcpy/span>span stylecolor: #008000;>(/span>nombre, vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>usuario/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>nombre, span stylecolor: #FF0000;>" dice: "/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>//Recortamos el TEXT TO, el nombre, y los dos espacios hasta el mensaje(se suma solo uno (un espacio) /span> span stylecolor: #666666;>//porque empieza a recorrer longitud(instruccion)+longitud(nombre) desde la pos. 0 de la cadena. /span> subCadenaspan stylecolor: #008000;>(/span>temp, buffer, span stylecolor: #0000dd;>8/span>span stylecolor: #000040;>+/span>longitudspan stylecolor: #000040;>+/span>span stylecolor: #0000dd;>1/span>, MAXLINEspan stylecolor: #000040;>-/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>8/span>span stylecolor: #000040;>+/span>longitudspan stylecolor: #000040;>+/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>nombre, tempspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>destino span stylecolor: #000040;>!/span>span stylecolor: #000080;>/span> span stylecolor: #000040;>-/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> sendspan stylecolor: #008000;>(/span>destino, nombre, MAXLINE, span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000dd;>fflush/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>stdout/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> closespan stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>socket/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span>span stylecolor: #008000;>}/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>#include <stdio.h>#include <string.h>#include <sys/types.h>#include <unistd.h>#include <stdlib.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <pthread.h>#define SERVER_PORT 6543#define SERVER_ADDRESS "127.0.0.1"#define MAXLINE 512#define MAXCLIENTS 10int buscarCliente(char*);void subCadena(char*, char*, int, int);struct vector{ int socket; char usuarioMAXLINE-4; int sign_in;};struct vector vectorClientesMAXCLIENTS;int clientes 0;int main(int argc, char *argv){ void* gestionaCliente(void* p); int socketfd, new_sd; socklen_t client_len; struct sockaddr_in server_addr, client_addr; int i, status, id; pthread_t hilosMAXCLIENTS; for(i0;i<MAXCLIENTS;i++) strcpy(vectorClientesi.usuario, " "); // Open TCP internet STREAM socket if ((socketfd socket(AF_INET, SOCK_STREAM, 0)) < 0) perror("server: Cant open stream socket"); // Bind local address to allow the client to connect bzero((char *) &server_addr, sizeof(server_addr)); server_addr.sin_family AF_INET; server_addr.sin_addr.s_addr htonl(INADDR_ANY); server_addr.sin_port htons(SERVER_PORT); if (bind (socketfd, (struct sockaddr *) &server_addr, sizeof(server_addr)) < 0) perror("server: cant bind local address"); listen(socketfd, 5); for (;;) { client_len sizeof(client_addr); if((new_sd accept(socketfd, (struct sockaddr *) &client_addr, &client_len)) < 0) { printf("Error aceptando peticiones\n"); exit(0); } else { id clientes; vectorClientesid.socket new_sd; vectorClientesid.sign_in 0; fflush(stdout); clientes++; if ( (status pthread_create(&hilosid,NULL,gestionaCliente,(void *)&id)) ) { printf("Error al crear el hilo\n"); exit(0); } } } close(socketfd); // Close original socket return 0;}void subCadena(char *subCad, char *cad, int inicio, int cuantos){ int i,j0; for(iinicio;i<inicio+cuantos && cadi!\0;i++) { subCadjcadi; j++; } subCadj\0;}int buscarCliente(char* usuario){ int i; for(i0;i<clientes;i++) { if(strcmp(vectorClientesi.usuario,usuario ) 0 && vectorClientesi.sign_in 1) return vectorClientesi.socket; } return -1;}void* gestionaCliente(void* p){ int *ide, id; ide (int* ) p; id *ide; char bufferMAXLINE, nombreMAXLINE-4, tempMAXLINE-8; int i, longitud, destino; while(1) { recv(vectorClientesid.socket,buffer,MAXLINE,0); printf("\nid%d\n", id); if(strstr(buffer, "ADD") && vectorClientesid.sign_in 0) { longitud strlen(buffer); //Le quitamos el ADD subCadena(nombre, buffer, 4, longitud-4); strcpy(vectorClientesid.usuario, nombre); //Se informa a todos menos a él mismo y al que se haya ido strcpy(buffer, "El usuario "); strcat(buffer, nombre); strcat(buffer, " ha entrado en el chat."); for(i 0; i < clientes; i++) if (i ! id && vectorClientesi.sign_in 1) send(vectorClientesi.socket,buffer,MAXLINE,0); vectorClientesid.sign_in 1; } if(strstr(buffer, "LIST") && vectorClientesid.sign_in 1) { //Se envia al cliente todos los usuarios menos los que hayan abandonado la sesión for(i 0; i < clientes; i++){ if(vectorClientesi.sign_in 1) send(vectorClientesid.socket, vectorClientesi.usuario, MAXLINE, 0); } } if(strstr(buffer, "END") && vectorClientesid.sign_in 1) { //Se informa a todos menos a él mismo y al que se haya ido strcpy(buffer, "El usuario "); strcat(buffer, vectorClientesid.usuario); strcat(buffer, " ha abandonado en el chat."); bzero(vectorClientesid.usuario, MAXLINE); for(i 0; i < clientes; i++) if (i ! id && vectorClientesi.sign_in 1) send(vectorClientesi.socket,buffer,MAXLINE,0); vectorClientesid.sign_in 0; } if(strstr(buffer, "TEXT") && !strstr(buffer, "TEXT TO") && vectorClientesid.sign_in 1) { longitud strlen(buffer); subCadena(temp, buffer, 5, longitud-5); //Se envía a todos menos a él mismo y al que se haya ido bzero(buffer, MAXLINE); strcat(buffer, vectorClientesid.usuario); strcat(buffer, " dice: "); strcat(buffer, temp); for(i 0; i < clientes; i++) if (i ! id && vectorClientesi.sign_in 1) send(vectorClientesi.socket,buffer,MAXLINE,0); } if(strstr(buffer, "TEXT TO") && vectorClientesid.sign_in 1) { //Le quitamos el TEXT TO subCadena(nombre, buffer, 8, MAXLINE-8); //Nos quedamos sólo con el nombre, quitando desde el primer espacio en blanco hasta el final strtok(nombre," "); //Se obtiene el socket destino destino buscarCliente(nombre); longitudstrlen(nombre); strcpy(nombre, vectorClientesid.usuario); strcat(nombre, " dice: "); //Recortamos el TEXT TO, el nombre, y los dos espacios hasta el mensaje(se suma solo uno (un espacio) //porque empieza a recorrer longitud(instruccion)+longitud(nombre) desde la pos. 0 de la cadena. subCadena(temp, buffer, 8+longitud+1, MAXLINE-(8+longitud+1)); strcat(nombre, temp); if(destino ! -1) send(destino, nombre, MAXLINE, 0); } fflush(stdout); } close(vectorClientesid.socket);}/p>/div>h5>Cliente/h5>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485/pre>/td>td classcode>pre classcpp stylefont-family:monospace;>span stylecolor: #339900;>#include <stdio.h>/span>span stylecolor: #339900;>#include <stdlib.h>/span>span stylecolor: #339900;>#include <unistd.h>/span>span stylecolor: #339900;>#include <netinet/in.h>/span>span stylecolor: #339900;>#include <arpa/inet.h>/span>span stylecolor: #339900;>#include <netdb.h>/span>span stylecolor: #339900;>#include <sys/types.h>/span>span stylecolor: #339900;>#include <sys/socket.h>/span>span stylecolor: #339900;>#include <pthread.h>/span>span stylecolor: #339900;>#include <string.h>/span> span stylecolor: #339900;>#define SERVER_PORT 6543/span>span stylecolor: #339900;>#define SERVER_ADDRESS "127.0.0.1"/span>span stylecolor: #339900;>#define MAXLINE 512/span> span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> recibirspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> pspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> enviarspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> pspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> mainspan stylecolor: #008000;>(/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>struct/span> sockaddr_in addrspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> sd,statusspan stylecolor: #008080;>;/span> pthread_t hilosspan stylecolor: #008000;>[/span>span stylecolor: #0000dd;>2/span>span stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> addr.span stylecolor: #007788;>sin_family/span> span stylecolor: #000080;>/span> AF_INETspan stylecolor: #008080;>;/span> addr.span stylecolor: #007788;>sin_addr/span>.span stylecolor: #007788;>s_addr/span> span stylecolor: #000080;>/span> inet_addrspan stylecolor: #008000;>(/span>SERVER_ADDRESSspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> addr.span stylecolor: #007788;>sin_port/span> span stylecolor: #000080;>/span> htonsspan stylecolor: #008000;>(/span>SERVER_PORTspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>span stylecolor: #008000;>(/span>sd span stylecolor: #000080;>/span> socket span stylecolor: #008000;>(/span>AF_INET, SOCK_STREAM, span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span> span stylecolor: #000080;>/span> span stylecolor: #000040;>-/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"Error al crear el socketspan stylecolor: #000099; font-weight: bold;>\n/span>"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>exit/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>connectspan stylecolor: #008000;>(/span>sd, span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>struct/span> sockaddr span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span>span stylecolor: #000040;>&/span>addr, span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>addrspan stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span> span stylecolor: #000080;>/span> span stylecolor: #000040;>-/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"Error al conectarspan stylecolor: #000099; font-weight: bold;>\n/span>"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>exit/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>else/span> span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>if/span> span stylecolor: #008000;>(/span> span stylecolor: #008000;>(/span>status span stylecolor: #000080;>/span> pthread_createspan stylecolor: #008000;>(/span>span stylecolor: #000040;>&/span>hilosspan stylecolor: #008000;>[/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>]/span>,span stylecolor: #0000ff;>NULL/span>,recibir,span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span>span stylecolor: #000040;>&/span>sdspan stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"Error al crear hilo para recibirspan stylecolor: #000099; font-weight: bold;>\n/span>"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> closespan stylecolor: #008000;>(/span>sdspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>exit/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>if/span> span stylecolor: #008000;>(/span> span stylecolor: #008000;>(/span>status span stylecolor: #000080;>/span> pthread_createspan stylecolor: #008000;>(/span>span stylecolor: #000040;>&/span>hilosspan stylecolor: #008000;>[/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>]/span>,span stylecolor: #0000ff;>NULL/span>,enviar,span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span>span stylecolor: #000040;>&/span>sdspan stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"Error al crear hilo para enviarspan stylecolor: #000099; font-weight: bold;>\n/span>"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> closespan stylecolor: #008000;>(/span>sdspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>exit/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> pthread_joinspan stylecolor: #008000;>(/span>hilosspan stylecolor: #008000;>[/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>]/span>,span stylecolor: #0000ff;>NULL/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> pthread_joinspan stylecolor: #008000;>(/span>hilosspan stylecolor: #008000;>[/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>]/span>,span stylecolor: #0000ff;>NULL/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>return/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008080;>;/span>span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> recibirspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> pspan stylecolor: #008000;>)/span>span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>int/span>span stylecolor: #000040;>*/span> idspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>char/span> bufferspan stylecolor: #008000;>[/span>MAXLINEspan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> id span stylecolor: #000080;>/span> span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span> pspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>while/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> recvspan stylecolor: #008000;>(/span>span stylecolor: #000040;>*/span>id,buffer,MAXLINE,span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"%sspan stylecolor: #000099; font-weight: bold;>\n/span>"/span>,bufferspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>fflush/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>stdout/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span>span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> enviarspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> pspan stylecolor: #008000;>)/span>span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>int/span>span stylecolor: #000040;>*/span> idspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>char/span> bufferspan stylecolor: #008000;>[/span>MAXLINEspan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> id span stylecolor: #000080;>/span> span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span> pspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>while/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"span stylecolor: #000099; font-weight: bold;>\t/span>Introduce el mensajespan stylecolor: #000099; font-weight: bold;>\n/span>-> "/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>fgets/span>span stylecolor: #008000;>(/span>buffer , MAXLINE , span stylecolor: #0000ff;>stdin/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strtok/span>span stylecolor: #008000;>(/span>buffer,span stylecolor: #FF0000;>"span stylecolor: #000099; font-weight: bold;>\n/span>"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> sendspan stylecolor: #008000;>(/span>span stylecolor: #000040;>*/span>id,buffer,MAXLINE,span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> sleepspan stylecolor: #008000;>(/span>span stylecolor: #0000dd;>3/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span>span stylecolor: #008000;>}/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <netinet/in.h>#include <arpa/inet.h>#include <netdb.h>#include <sys/types.h>#include <sys/socket.h>#include <pthread.h>#include <string.h>#define SERVER_PORT 6543#define SERVER_ADDRESS "127.0.0.1"#define MAXLINE 512void* recibir(void* p);void* enviar(void* p);int main(){ struct sockaddr_in addr; int sd,status; pthread_t hilos2; addr.sin_family AF_INET; addr.sin_addr.s_addr inet_addr(SERVER_ADDRESS); addr.sin_port htons(SERVER_PORT); if((sd socket (AF_INET, SOCK_STREAM, 0)) -1) { printf("Error al crear el socket\n"); exit(0); } if(connect(sd, (struct sockaddr *)&addr, sizeof(addr)) -1) { printf("Error al conectar\n"); exit(0); } else { if ( (status pthread_create(&hilos0,NULL,recibir,(void*)&sd)) ) { printf("Error al crear hilo para recibir\n"); close(sd); exit(0); } if ( (status pthread_create(&hilos1,NULL,enviar,(void*)&sd)) ) { printf("Error al crear hilo para enviar\n"); close(sd); exit(0); } pthread_join(hilos0,NULL); pthread_join(hilos1,NULL); } return 1;}void* recibir(void* p){ int* id; char bufferMAXLINE; id (int*) p; while(1) { recv(*id,buffer,MAXLINE,0); printf("%s\n",buffer); fflush(stdout); }}void* enviar(void* p){ int* id; char bufferMAXLINE; id (int*) p; while(1) { printf("\tIntroduce el mensaje\n-> "); fgets(buffer , MAXLINE , stdin); strtok(buffer,"\n"); send(*id,buffer,MAXLINE,0); sleep(3); }}/p>/div>p>img loadinglazy classalignnone wp-image-210 size-full srchttp://davidlopez.es/wp-content/uploads/2016/04/chat-en-c-2.png altchat-en-c-2 width996 height689 srcsethttps://davidlopez.es/wp-content/uploads/2016/04/chat-en-c-2.png 996w, https://davidlopez.es/wp-content/uploads/2016/04/chat-en-c-2-300x208.png 300w, https://davidlopez.es/wp-content/uploads/2016/04/chat-en-c-2-768x531.png 768w sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px />/p>h4>/h4>h4>/h4>h4>En Python/h4>h5>Servidor/h5>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980/pre>/td>td classcode>pre classpython stylefont-family:monospace;>span stylecolor: #808080; font-style: italic;>#!/usr/bin/python/span>span stylecolor: #808080; font-style: italic;># -*- coding: utf-8 -*-/span>span stylecolor: #808080; font-style: italic;>#Servidor/span> span stylecolor: #ff7700;font-weight:bold;>import/span> span stylecolor: #dc143c;>string/span>span stylecolor: #ff7700;font-weight:bold;>import/span> span stylecolor: #dc143c;>threading/span>span stylecolor: #ff7700;font-weight:bold;>import/span> span stylecolor: #dc143c;>socket/span> clientes span stylecolor: #66cc66;>/span> span stylecolor: black;>{/span>span stylecolor: #483d8b;>nombre/span>:span stylecolor: black;>[/span>span stylecolor: black;>]/span>span stylecolor: #66cc66;>,/span> span stylecolor: #483d8b;>socket/span>:span stylecolor: black;>[/span>span stylecolor: black;>]/span>span stylecolor: black;>}/span> span stylecolor: #ff7700;font-weight:bold;>class/span> gestionaClientesspan stylecolor: black;>(/span>span stylecolor: #dc143c;>threading/span>.span stylecolor: black;>Thread/span>span stylecolor: black;>)/span>: span stylecolor: #ff7700;font-weight:bold;>def/span> span stylecolor: #0000cd;>__init__/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: #66cc66;>,/span> span stylecolor: #dc143c;>socket/span>span stylecolor: black;>)/span>: span stylecolor: #dc143c;>threading/span>.span stylecolor: black;>Thread/span>.span stylecolor: #0000cd;>__init__/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span> span stylecolor: #66cc66;>/span> span stylecolor: #dc143c;>socket/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conectado/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>False/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span> span stylecolor: #66cc66;>/span> span stylecolor: #483d8b;>/span> span stylecolor: #ff7700;font-weight:bold;>def/span> runspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: black;>)/span>: span stylecolor: #ff7700;font-weight:bold;>while/span> span stylecolor: #008000;>True/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>recv/span>span stylecolor: black;>(/span> span stylecolor: #ff4500;>1024/span> span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>if/span> span stylecolor: #483d8b;>ADD/span> span stylecolor: #ff7700;font-weight:bold;>in/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>: span stylecolor: #808080; font-style: italic;>#Busca si ya ha sido insertado/span> span stylecolor: #ff7700;font-weight:bold;>if/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conectado/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>False/span>span stylecolor: black;>)/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>conectado/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>True/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>nombre/span>span stylecolor: black;>]/span>.span stylecolor: black;>append/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>span stylecolor: black;>[/span>span stylecolor: #ff4500;>4/span>:span stylecolor: black;>]/span>span stylecolor: black;>)/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>.span stylecolor: black;>append/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>for/span> i span stylecolor: #ff7700;font-weight:bold;>in/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>: span stylecolor: #ff7700;font-weight:bold;>if/span> i span stylecolor: #66cc66;>!/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>: i.span stylecolor: black;>send/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>span stylecolor: black;>[/span>span stylecolor: #ff4500;>4/span>:span stylecolor: black;>]/span>+span stylecolor: #483d8b;>" ha entrado en el chat."/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>else/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>send/span>span stylecolor: black;>(/span>span stylecolor: #483d8b;>"Ya estás en el chat."/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>print/span> clientes span stylecolor: #ff7700;font-weight:bold;>if/span> span stylecolor: black;>(/span>span stylecolor: #483d8b;>LIST/span> span stylecolor: #ff7700;font-weight:bold;>in/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>and/span> span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conectado/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>True/span>span stylecolor: black;>)/span>: span stylecolor: #ff7700;font-weight:bold;>for/span> i span stylecolor: #ff7700;font-weight:bold;>in/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>nombre/span>span stylecolor: black;>]/span>: span stylecolor: #ff7700;font-weight:bold;>print/span> span stylecolor: #483d8b;>"enviado a "/span>+span stylecolor: #008000;>str/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>span stylecolor: black;>)/span>+span stylecolor: #483d8b;>" "/span>+span stylecolor: #008000;>str/span>span stylecolor: black;>(/span>ispan stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>send/span>span stylecolor: black;>(/span>i+span stylecolor: #483d8b;>" "/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>print/span> clientes span stylecolor: #ff7700;font-weight:bold;>if/span> span stylecolor: black;>(/span>span stylecolor: #483d8b;>END/span> span stylecolor: #ff7700;font-weight:bold;>in/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>span stylecolor: black;>)/span>: span stylecolor: #ff7700;font-weight:bold;>if/span> span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conectado/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>True/span>span stylecolor: black;>)/span>: span stylecolor: #ff7700;font-weight:bold;>for/span> i span stylecolor: #ff7700;font-weight:bold;>in/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>: span stylecolor: #ff7700;font-weight:bold;>if/span> i span stylecolor: #66cc66;>/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>: nombre span stylecolor: #66cc66;>/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>nombre/span>span stylecolor: black;>]/span>span stylecolor: black;>[/span>clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>.span stylecolor: black;>index/span>span stylecolor: black;>(/span>ispan stylecolor: black;>)/span>span stylecolor: black;>]/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>nombre/span>span stylecolor: black;>]/span>.span stylecolor: black;>remove/span>span stylecolor: black;>(/span>nombrespan stylecolor: black;>)/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>.span stylecolor: black;>remove/span>span stylecolor: black;>(/span>ispan stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conectado/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>False/span> span stylecolor: #ff7700;font-weight:bold;>for/span> i span stylecolor: #ff7700;font-weight:bold;>in/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>: span stylecolor: #ff7700;font-weight:bold;>if/span> i span stylecolor: #66cc66;>!/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>: i.span stylecolor: black;>send/span>span stylecolor: black;>(/span>nombre+span stylecolor: #483d8b;>" ha salido del chat."/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>send/span>span stylecolor: black;>(/span>span stylecolor: #483d8b;>" "/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>else/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>send/span>span stylecolor: black;>(/span>span stylecolor: #483d8b;>" "/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>if/span> span stylecolor: black;>(/span>span stylecolor: #483d8b;>TEXT/span> span stylecolor: #ff7700;font-weight:bold;>in/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span> span stylecolor: #ff7700;font-weight:bold;>and/span> span stylecolor: #483d8b;>TEXT TO/span> span stylecolor: #ff7700;font-weight:bold;>not/span> span stylecolor: #ff7700;font-weight:bold;>in/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>and/span> span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conectado/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>True/span>span stylecolor: black;>)/span>: span stylecolor: #ff7700;font-weight:bold;>for/span> i span stylecolor: #ff7700;font-weight:bold;>in/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>: span stylecolor: #ff7700;font-weight:bold;>if/span> i span stylecolor: #66cc66;>!/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>: i.span stylecolor: black;>send/span>span stylecolor: black;>(/span>clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>nombre/span>span stylecolor: black;>]/span>span stylecolor: black;>[/span>clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>.span stylecolor: black;>index/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>span stylecolor: black;>)/span>span stylecolor: black;>]/span>+span stylecolor: #483d8b;>" dice: "/span>+span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>span stylecolor: black;>[/span>span stylecolor: #ff4500;>5/span>:span stylecolor: black;>]/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>print/span> clientes span stylecolor: #ff7700;font-weight:bold;>if/span> span stylecolor: black;>(/span>span stylecolor: #483d8b;>TEXT TO/span> span stylecolor: #ff7700;font-weight:bold;>in/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>and/span> span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conectado/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>True/span>span stylecolor: black;>)/span>: palabras span stylecolor: #66cc66;>/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>span stylecolor: black;>[/span>span stylecolor: #ff4500;>8/span>:span stylecolor: black;>]/span>.span stylecolor: black;>split/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span> span stylecolor: #808080; font-style: italic;>#busca si existe alguien con ese alias/span> span stylecolor: #ff7700;font-weight:bold;>for/span> i span stylecolor: #ff7700;font-weight:bold;>in/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>nombre/span>span stylecolor: black;>]/span>: span stylecolor: #ff7700;font-weight:bold;>if/span> i span stylecolor: #66cc66;>/span> palabrasspan stylecolor: black;>[/span>span stylecolor: #ff4500;>0/span>span stylecolor: black;>]/span>: span stylecolor: #808080; font-style: italic;>#Prepara el mensaje/span> span stylecolor: #ff7700;font-weight:bold;>del/span> palabrasspan stylecolor: black;>[/span>span stylecolor: #ff4500;>0/span>span stylecolor: black;>]/span> mensaje span stylecolor: #66cc66;>/span> span stylecolor: #dc143c;>string/span>.span stylecolor: black;>join/span>span stylecolor: black;>(/span>palabrasspan stylecolor: #66cc66;>,/span> span stylecolor: #483d8b;> /span>span stylecolor: black;>)/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>span stylecolor: black;>[/span>clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>nombre/span>span stylecolor: black;>]/span>.span stylecolor: black;>index/span>span stylecolor: black;>(/span>ispan stylecolor: black;>)/span>span stylecolor: black;>]/span>.span stylecolor: black;>send/span>span stylecolor: black;>(/span>clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>nombre/span>span stylecolor: black;>]/span>span stylecolor: black;>[/span>clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>.span stylecolor: black;>index/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>span stylecolor: black;>)/span>span stylecolor: black;>]/span>+span stylecolor: #483d8b;>" dice: "/span>+mensajespan stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>close/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span> span stylecolor: #808080; font-style: italic;>#creamos socket pasivo y escuchamos en el puerto 9000/span>s span stylecolor: #66cc66;>/span> span stylecolor: #dc143c;>socket/span>.span stylecolor: #dc143c;>socket/span>span stylecolor: black;>(/span> span stylecolor: #dc143c;>socket/span>.span stylecolor: black;>AF_INET/span>span stylecolor: #66cc66;>,/span> span stylecolor: #dc143c;>socket/span>.span stylecolor: black;>SOCK_STREAM/span> span stylecolor: black;>)/span>s.span stylecolor: black;>bind/span>span stylecolor: black;>(/span> span stylecolor: black;>(/span> span stylecolor: #dc143c;>socket/span>.span stylecolor: black;>gethostname/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span>span stylecolor: #66cc66;>,/span> span stylecolor: #ff4500;>9000/span> span stylecolor: black;>)/span> span stylecolor: black;>)/span>s.span stylecolor: black;>listen/span>span stylecolor: black;>(/span> span stylecolor: #ff4500;>5/span> span stylecolor: black;>)/span>span stylecolor: #ff7700;font-weight:bold;>while/span>span stylecolor: black;>(/span>span stylecolor: #008000;>True/span>span stylecolor: black;>)/span>: connspan stylecolor: #66cc66;>,/span> addr span stylecolor: #66cc66;>/span> s.span stylecolor: black;>accept/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span> gestionaClientesspan stylecolor: black;>(/span>connspan stylecolor: black;>)/span>.span stylecolor: black;>start/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>#!/usr/bin/python# -*- coding: utf-8 -*-#Servidorimport stringimport threadingimport socketclientes {nombre:, socket:}class gestionaClientes(threading.Thread): def __init__(self, socket): threading.Thread.__init__(self) self.conn socket self.conectado False self.data def run(self): while True: self.data self.conn.recv( 1024 ) if ADD in self.data: #Busca si ya ha sido insertado if(self.conectado False): self.conectado True clientesnombre.append(self.data4:) clientessocket.append(self.conn) for i in clientessocket: if i ! self.conn: i.send(self.data4:+" ha entrado en el chat.") else: self.conn.send("Ya estás en el chat.") print clientes if (LIST in self.data) and (self.conectado True): for i in clientesnombre: print "enviado a "+str(self.conn)+" "+str(i) self.conn.send(i+" ") print clientes if (END in self.data): if (self.conectado True): for i in clientessocket: if i self.conn: nombre clientesnombreclientessocket.index(i) clientesnombre.remove(nombre) clientessocket.remove(i) self.conectado False for i in clientessocket: if i ! self.conn: i.send(nombre+" ha salido del chat.") self.conn.send(" ") else: self.conn.send(" ") if (TEXT in self.data and TEXT TO not in self.data) and (self.conectado True): for i in clientessocket: if i ! self.conn: i.send(clientesnombreclientessocket.index(self.conn)+" dice: "+self.data5:) print clientes if (TEXT TO in self.data) and (self.conectado True): palabras self.data8:.split() #busca si existe alguien con ese alias for i in clientesnombre: if i palabras0: #Prepara el mensaje del palabras0 mensaje string.join(palabras, ) clientessocketclientesnombre.index(i).send(clientesnombreclientessocket.index(self.conn)+" dice: "+mensaje) self.conn.close() #creamos socket pasivo y escuchamos en el puerto 9000s socket.socket( socket.AF_INET, socket.SOCK_STREAM )s.bind( ( socket.gethostname(), 9000 ) )s.listen( 5 )while(True): conn, addr s.accept() gestionaClientes(conn).start()/p>/div>h5>Cliente/h5>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374/pre>/td>td classcode>pre classpython stylefont-family:monospace;>span stylecolor: #808080; font-style: italic;>#!/usr/bin/python/span>span stylecolor: #808080; font-style: italic;># -*- coding: utf-8 -*-/span>span stylecolor: #808080; font-style: italic;>#Cliente/span> span stylecolor: #ff7700;font-weight:bold;>from/span> span stylecolor: #dc143c;>Tkinter/span> span stylecolor: #ff7700;font-weight:bold;>import/span> *span stylecolor: #ff7700;font-weight:bold;>import/span> span stylecolor: #dc143c;>threading/span>span stylecolor: #ff7700;font-weight:bold;>import/span> span stylecolor: #dc143c;>socket/span> span stylecolor: #ff7700;font-weight:bold;>class/span> App: span stylecolor: #ff7700;font-weight:bold;>def/span> span stylecolor: #0000cd;>__init__/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: #66cc66;>,/span> masterspan stylecolor: #66cc66;>,/span> span stylecolor: #dc143c;>socket/span>span stylecolor: black;>)/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span> span stylecolor: #66cc66;>/span> span stylecolor: #dc143c;>socket/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span> span stylecolor: #66cc66;>/span> Framespan stylecolor: black;>(/span>masterspan stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>label/span> span stylecolor: #66cc66;>/span> Labelspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span>span stylecolor: #66cc66;>,/span> textspan stylecolor: #66cc66;>/span>span stylecolor: #483d8b;>"Cliente chat. Python+TkInter. David López"/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>textarea/span> span stylecolor: #66cc66;>/span> Textspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span>span stylecolor: #66cc66;>,/span> heightspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>20/span>span stylecolor: #66cc66;>,/span> widthspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>40/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>scroll/span> span stylecolor: #66cc66;>/span> Scrollbarspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span>span stylecolor: #66cc66;>,/span> commandspan stylecolor: #66cc66;>/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>textarea/span>.span stylecolor: black;>yview/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>textarea/span>.span stylecolor: black;>configure/span>span stylecolor: black;>(/span>yscrollcommandspan stylecolor: #66cc66;>/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>scroll/span>.span stylecolor: #008000;>set/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>texto_enviar/span> span stylecolor: #66cc66;>/span> StringVarspan stylecolor: black;>(/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>text_ent/span> span stylecolor: #66cc66;>/span> Entryspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span>span stylecolor: #66cc66;>,/span> textvariablespan stylecolor: #66cc66;>/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>texto_enviar/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>btn_enviar/span> span stylecolor: #66cc66;>/span> Buttonspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span>span stylecolor: #66cc66;>,/span> textspan stylecolor: #66cc66;>/span>span stylecolor: #483d8b;>"Enviar"/span>span stylecolor: #66cc66;>,/span> commandspan stylecolor: #66cc66;>/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>enviar/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>btn_salir/span> span stylecolor: #66cc66;>/span> Buttonspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span>span stylecolor: #66cc66;>,/span> textspan stylecolor: #66cc66;>/span>span stylecolor: #483d8b;>"Salir"/span>span stylecolor: #66cc66;>,/span> commandspan stylecolor: #66cc66;>/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>salir/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span>.span stylecolor: black;>grid/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>label/span>.span stylecolor: black;>grid/span>span stylecolor: black;>(/span>rowspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>0/span>span stylecolor: #66cc66;>,/span> columnspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>0/span>span stylecolor: #66cc66;>,/span> columnspanspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>3/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>textarea/span>.span stylecolor: black;>grid/span>span stylecolor: black;>(/span>rowspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>1/span>span stylecolor: #66cc66;>,/span> columnspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>0/span>span stylecolor: #66cc66;>,/span> columnspanspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>2/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>scroll/span>.span stylecolor: black;>grid/span>span stylecolor: black;>(/span>rowspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>1/span>span stylecolor: #66cc66;>,/span> columnspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>2/span>span stylecolor: #66cc66;>,/span> stickyspan stylecolor: #66cc66;>/span>N+Sspan stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>text_ent/span>.span stylecolor: black;>grid/span>span stylecolor: black;>(/span>rowspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>2/span>span stylecolor: #66cc66;>,/span> columnspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>0/span>span stylecolor: #66cc66;>,/span> columnspanspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>2/span>span stylecolor: #66cc66;>,/span> stickyspan stylecolor: #66cc66;>/span>W+Espan stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>btn_enviar/span>.span stylecolor: black;>grid/span>span stylecolor: black;>(/span>rowspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>3/span>span stylecolor: #66cc66;>,/span> columnspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>0/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>btn_salir/span>.span stylecolor: black;>grid/span>span stylecolor: black;>(/span>rowspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>3/span>span stylecolor: #66cc66;>,/span> columnspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>1/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>def/span> enviarspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: black;>)/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>send/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>text_ent/span>.span stylecolor: black;>get/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>text_ent/span>.span stylecolor: black;>delete/span>span stylecolor: black;>(/span>span stylecolor: #ff4500;>0/span>span stylecolor: #66cc66;>,/span> ENDspan stylecolor: black;>)/span> span stylecolor: #808080; font-style: italic;># Esta es una función de retrollamada./span> span stylecolor: #ff7700;font-weight:bold;>def/span> salirspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: black;>)/span>: lee.span stylecolor: black;>parar/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>send/span>span stylecolor: black;>(/span>span stylecolor: #483d8b;>"END"/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span>.span stylecolor: black;>quit/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>def/span> escribirspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: #66cc66;>,/span> textospan stylecolor: black;>)/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>textarea/span>.span stylecolor: black;>insert/span>span stylecolor: black;>(/span>ENDspan stylecolor: #66cc66;>,/span> textospan stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>class/span> leerspan stylecolor: black;>(/span>span stylecolor: #dc143c;>threading/span>.span stylecolor: black;>Thread/span>span stylecolor: black;>)/span>: span stylecolor: #ff7700;font-weight:bold;>def/span> span stylecolor: #0000cd;>__init__/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: #66cc66;>,/span> span stylecolor: #dc143c;>socket/span>span stylecolor: black;>)/span>: span stylecolor: #dc143c;>threading/span>.span stylecolor: black;>Thread/span>.span stylecolor: #0000cd;>__init__/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>mensaje/span> span stylecolor: #66cc66;>/span> span stylecolor: #483d8b;>/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span> span stylecolor: #66cc66;>/span> span stylecolor: #dc143c;>socket/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>stop/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>False/span> span stylecolor: #ff7700;font-weight:bold;>def/span> runspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: black;>)/span>: span stylecolor: #ff7700;font-weight:bold;>while/span> span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>stop/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>False/span>span stylecolor: black;>)/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>mensaje/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>recv/span>span stylecolor: black;>(/span> span stylecolor: #ff4500;>1024/span> span stylecolor: black;>)/span> app.span stylecolor: black;>escribir/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>mensaje/span>+span stylecolor: #483d8b;>span stylecolor: #000099; font-weight: bold;>\n/span>/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>close/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>def/span> pararspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: black;>)/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>stop/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>True/span> miSocket span stylecolor: #66cc66;>/span> span stylecolor: #dc143c;>socket/span>.span stylecolor: #dc143c;>socket/span>span stylecolor: black;>(/span> span stylecolor: #dc143c;>socket/span>.span stylecolor: black;>AF_INET/span>span stylecolor: #66cc66;>,/span> span stylecolor: #dc143c;>socket/span>.span stylecolor: black;>SOCK_STREAM/span> span stylecolor: black;>)/span>miSocket.span stylecolor: black;>connect/span>span stylecolor: black;>(/span> span stylecolor: black;>(/span>span stylecolor: #dc143c;>socket/span>.span stylecolor: black;>gethostname/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span>span stylecolor: #66cc66;>,/span> span stylecolor: #ff4500;>9000/span> span stylecolor: black;>)/span> span stylecolor: black;>)/span> lee span stylecolor: #66cc66;>/span> leerspan stylecolor: black;>(/span>miSocketspan stylecolor: black;>)/span> lee.span stylecolor: black;>start/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span> root span stylecolor: #66cc66;>/span> Tkspan stylecolor: black;>(/span>span stylecolor: black;>)/span>root.span stylecolor: black;>title/span>span stylecolor: black;>(/span>span stylecolor: #483d8b;>Chat Python-TkInter - David López/span>span stylecolor: black;>)/span>app span stylecolor: #66cc66;>/span> Appspan stylecolor: black;>(/span>rootspan stylecolor: #66cc66;>,/span> miSocketspan stylecolor: black;>)/span> root.span stylecolor: black;>mainloop/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>#!/usr/bin/python# -*- coding: utf-8 -*-#Clientefrom Tkinter import *import threadingimport socketclass App: def __init__(self, master, socket): self.conn socket self.frame Frame(master) self.label Label(self.frame, text"Cliente chat. Python+TkInter. David López") self.textarea Text(self.frame, height20, width40) self.scroll Scrollbar(self.frame, commandself.textarea.yview) self.textarea.configure(yscrollcommandself.scroll.set) self.texto_enviar StringVar() self.text_ent Entry(self.frame, textvariableself.texto_enviar) self.btn_enviar Button(self.frame, text"Enviar", commandself.enviar) self.btn_salir Button(self.frame, text"Salir", commandself.salir) self.frame.grid() self.label.grid(row0, column0, columnspan3) self.textarea.grid(row1, column0, columnspan2) self.scroll.grid(row1, column2, stickyN+S) self.text_ent.grid(row2, column0, columnspan2, stickyW+E) self.btn_enviar.grid(row3, column0) self.btn_salir.grid(row3, column1) def enviar(self): self.conn.send(self.text_ent.get()) self.text_ent.delete(0, END) # Esta es una función de retrollamada. def salir(self): lee.parar() self.conn.send("END") self.frame.quit() def escribir(self, texto): self.textarea.insert(END, texto)class leer(threading.Thread): def __init__(self, socket): threading.Thread.__init__(self) self.mensaje self.conn socket self.stop False def run(self): while (self.stop False): self.mensaje self.conn.recv( 1024 ) app.escribir(self.mensaje+\n) self.conn.close() def parar(self): self.stop TruemiSocket socket.socket( socket.AF_INET, socket.SOCK_STREAM )miSocket.connect( (socket.gethostname(), 9000 ) )lee leer(miSocket)lee.start()root Tk()root.title(Chat Python-TkInter - David López)app App(root, miSocket)root.mainloop()/p>/div>p> /p>p> /p>p>img loadinglazy classalignnone wp-image-170 size-full srchttp://davidlopez.es/wp-content/uploads/2016/04/chatgrafico.png altchatgrafico width981 height599 srcsethttps://davidlopez.es/wp-content/uploads/2016/04/chatgrafico.png 981w, https://davidlopez.es/wp-content/uploads/2016/04/chatgrafico-300x183.png 300w, https://davidlopez.es/wp-content/uploads/2016/04/chatgrafico-768x469.png 768w sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px />/p> /div>!-- .entry-content --> /article>!-- #post-169 -->article idpost-163 classpost-163 post type-post status-publish format-standard has-post-thumbnail hentry category-sistemas-operativos tag-boot tag-grub tag-sistemas-operativos> header classentry-header> div classentry-meta>span classscreen-reader-text>Publicado el/span> a hrefhttps://davidlopez.es/cambiar-el-fondo-de-grub-2-0-con-grub-customizer/ relbookmark>time classentry-date published datetime2016-04-20T00:08:57+00:00>20 abril, 2016/time>time classupdated datetime2016-04-20T00:09:34+00:00>20 abril, 2016/time>/a>/div>!-- .entry-meta -->h2 classentry-title>a hrefhttps://davidlopez.es/cambiar-el-fondo-de-grub-2-0-con-grub-customizer/ relbookmark>Cambiar el fondo de Grub 2.0 con Grub-customizer/a>/h2> /header>!-- .entry-header --> div classpost-thumbnail> a hrefhttps://davidlopez.es/cambiar-el-fondo-de-grub-2-0-con-grub-customizer/> img width1600 height1200 srchttps://davidlopez.es/wp-content/uploads/2016/04/grub.jpg classattachment-twentyseventeen-featured-image size-twentyseventeen-featured-image wp-post-image alt loadinglazy srcsethttps://davidlopez.es/wp-content/uploads/2016/04/grub.jpg 1600w, https://davidlopez.es/wp-content/uploads/2016/04/grub-300x225.jpg 300w, https://davidlopez.es/wp-content/uploads/2016/04/grub-768x576.jpg 768w, https://davidlopez.es/wp-content/uploads/2016/04/grub-1024x768.jpg 1024w sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px /> /a> /div>!-- .post-thumbnail --> div classentry-content> p>Hay bastantes mejoras en Grub Customizer 2.0. Entre ellas, la posibilidad de seleccionar la entrada por defecto que está seleccionada para arrancar, el tiempo límite de interacción, o el establecimiento de parámetros del núcleo./p>p>Además en el caso de Grub 2.0 hay algunas características especiales como cambiar los colores del menú o la imagen de fondo. Para instalar la aplicación en Ubuntu podéis hacer lo siguiente:/p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #c20cb9; font-weight: bold;>sudo/span> add-apt-repository ppa:danielrichter2007span stylecolor: #000000; font-weight: bold;>//span>grub-customizerspan stylecolor: #c20cb9; font-weight: bold;>sudo/span> span stylecolor: #c20cb9; font-weight: bold;>apt-get update/span>span stylecolor: #c20cb9; font-weight: bold;>sudo/span> span stylecolor: #c20cb9; font-weight: bold;>apt-get install/span> grub-customizer/pre>/td>/tr>/table>p classtheCode styledisplay:none;>sudo add-apt-repository ppa:danielrichter2007/grub-customizersudo apt-get updatesudo apt-get install grub-customizer/p>/div>p>Y a partir de ahí podréis lanzar la aplicación desde terminal o con el menú Aplicaciones/Herramientas de Sistema/Grub Customizer./p>p>img loadinglazy classalignnone size-medium wp-image-164 srchttp://davidlopez.es/wp-content/uploads/2016/04/grub-300x225.jpg altgrub width300 height225 srcsethttps://davidlopez.es/wp-content/uploads/2016/04/grub-300x225.jpg 300w, https://davidlopez.es/wp-content/uploads/2016/04/grub-768x576.jpg 768w, https://davidlopez.es/wp-content/uploads/2016/04/grub-1024x768.jpg 1024w, https://davidlopez.es/wp-content/uploads/2016/04/grub.jpg 1600w sizes(max-width: 300px) 100vw, 300px />/p> /div>!-- .entry-content --> /article>!-- #post-163 -->article idpost-134 classpost-134 post type-post status-publish format-standard has-post-thumbnail hentry category-programacion tag-client tag-rpc tag-server tag-xdr> header classentry-header> div classentry-meta>span classscreen-reader-text>Publicado el/span> a hrefhttps://davidlopez.es/134/ relbookmark>time classentry-date published datetime2016-04-19T23:05:29+00:00>19 abril, 2016/time>time classupdated datetime2016-04-24T23:38:04+00:00>24 abril, 2016/time>/a>/div>!-- .entry-meta -->h2 classentry-title>a hrefhttps://davidlopez.es/134/ relbookmark>Llamadas a procedimiento remoto (RPC): Un servidor horario/a>/h2> /header>!-- .entry-header --> div classpost-thumbnail> a hrefhttps://davidlopez.es/134/> img width779 height623 srchttps://davidlopez.es/wp-content/uploads/2016/04/rpc.png classattachment-twentyseventeen-featured-image size-twentyseventeen-featured-image wp-post-image alt loadinglazy srcsethttps://davidlopez.es/wp-content/uploads/2016/04/rpc.png 779w, https://davidlopez.es/wp-content/uploads/2016/04/rpc-300x240.png 300w, https://davidlopez.es/wp-content/uploads/2016/04/rpc-768x614.png 768w sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px /> /a> /div>!-- .post-thumbnail --> div classentry-content> p styletext-align: justify; alignjustify>strong>RPC/strong> (Remote Procedure Call) es una tecnología, tradicionalmente empleada en ambiente UNIX, que permite el desarrollo de sistemas de procesamiento distribuido basados en el paradigma procedimental./p>p styletext-align: justify; alignjustify>Una llamada a un procedimiento (función o subrutina) es un método bien conocido para transferir el control de una parte del programa a otra, con un retorno del control a la primera. Asociado con la llamada a un procedimiento están el pase de argumentos y el retorno de uno o varios resultados. Cuando el código que invoca a un procedimiento y dicho procedimiento están en un mismo proceso en un computador dado, se dice que ha ocurrido una llamada a un procedimiento local./p>p styletext-align: justify; alignjustify>Por el contrario, en una llamada a un procedimiento remoto (RPC, Remote Proceure Call) el sistema local invoca, a través de la red, a una función alojada en otro sistema. Lo que se pretende es hacerle parecer al programador que está ocurriendo una simple llamada local. Este es el flujo de datos en el modelo RPC:/p>p styletext-align: justify; alignjustify>img loadinglazy classwp-image-140 size-full aligncenter srchttp://davidlopez.es/wp-content/uploads/2016/04/rpc.png altrpc width779 height623 srcsethttps://davidlopez.es/wp-content/uploads/2016/04/rpc.png 779w, https://davidlopez.es/wp-content/uploads/2016/04/rpc-300x240.png 300w, https://davidlopez.es/wp-content/uploads/2016/04/rpc-768x614.png 768w sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px />/p>p styletext-align: justify;>Para este ejemplo se va a asumir que el entorno de trabajo ahora mismo es linux con gcc y rpcgen instalado.Los pasos para hacer que todo funcione son 4, y se describen a continuación:/p>ol>li styletext-align: justify;>La definición del XDR, usando ese lenguaje para especificar qué funciones quiere “publicar” el servidor, y cómo se han de llamar por parte del cliente./li>li styletext-align: justify;>La implementación de los métodos remotos, para tener un código que ejecutar cuando nos hagan una llamada remota./li>li styletext-align: justify;>La implementación de un cliente que invoque los métodos del servidor./li>li styletext-align: justify;>La compilación de todo esto y una ejecución de prueba./li>/ol>h2>/h2>h2>XDR/h2>p styletext-align: justify;>XDR (External Data Representation) es un estándar para la descripción y codificación de datos que utiliza un lenguaje cuya sintaxis es similar a la del lenguaje de programación C. Es empleado principalmente en la transferencia de información entre diferentes arquitecturas computacionales y se ubica dentro de la capa de presentación del modelo ISO. Involucra un mecanismo de tipificado implícito (Implicit Typing), es decir que sólo viaja el valor de la variable por la red./p>p styletext-align: justify;>Es importante resaltar que XDR no es un lenguaje de programación, sino una especificación que incluye un lenguaje de descripción de datos el cual es extendido por ONC-RPC para la definición de procedimientos remotos. Los tipos de datos de XDR presentan cierta similitud con los tipos de datos de C. Algunos de estos son:/p>ul>li>int/li>li>unsigned int/li>li>enum/li>li>bool/li>li>hyper/li>li>unsigned hyper/li>li>float/li>li>double/li>li>quadruple (punto flotante de cuádruple precisión)/li>li>opaque (de longitud fija o variable)/li>li>string/li>li>array (de longitud fija o variable)/li>li>struct/li>li>union (uniones discriminadas)/li>li>void/li>li>constant/li>/ul>p>El lenguaje especificado por RPC es idéntico al lenguaje de XDR, excepto que agrega la definición de «programa», cuya gramática es mostrada a continuación:/p>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>123456789101112131415/pre>/td>td classcode>pre classrpc stylefont-family:monospace;>program-def: "program" identifier "{" version-def version-def * "}" "" constant ";" version-def: "version" identifier "{" procedure-def procedure-def * "}" "" constant ";" procedure-def: type-specifier identifier "(" type-specifier("," type-specifier )* ")" "" constant ";"/pre>/td>/tr>/table>p classtheCode styledisplay:none;>program-def: "program" identifier "{" version-def version-def * "}" "" constant ";"version-def: "version" identifier "{" procedure-def procedure-def * "}" "" constant ";"procedure-def: type-specifier identifier "(" type-specifier("," type-specifier )* ")" "" constant ";"/p>/div>p>Lo primero es definir qué métodos está ofreciendo el servidor así como los parámetros que admite y el tipo de retorno. Esto lo hacemos en un fichero .x como el siguiente:/p>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>12345/pre>/td>td classcode>pre classrpc stylefont-family:monospace;>program HORA_PROG {version HORA_VERS {string HORA(void) 1; /*devuelve una cadena*/} 1;} 0x31230000;/pre>/td>/tr>/table>p classtheCode styledisplay:none;>program HORA_PROG {version HORA_VERS {string HORA(void) 1; /*devuelve una cadena*/} 1;} 0x31230000;/p>/div>p styletext-align: justify;>Las partes importantes del fichero son la definición de la estructura Operandos (en el anterior ejemplo no la hay) y el program { version { con las definiciones de las funciones. La definición de Operandos permite definir estructuras prácticamente arbitrarias como tipos para parámetros y retornos. Un ejemplo de fichero XDR con definición de operandos sería el siguiente, aunque no se usa en esta ocasión:/p>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>123456789/pre>/td>td classcode>pre classxdr stylefont-family:monospace;>struct hora {char arg90;}; program HORA_PROG {version HORA_VERS {hora HORA(void) 1; /*devuelve una cadena*/} 1;} 0x31230000;/pre>/td>/tr>/table>p classtheCode styledisplay:none;>struct hora {char arg90;};program HORA_PROG {version HORA_VERS {hora HORA(void) 1; /*devuelve una cadena*/} 1;} 0x31230000;/p>/div>p styletext-align: justify;>Los program son una manera de agrupar primitivas (he usado el convenio de notación de Sun para nombrarlo). El valor 0×31230000 es un identificador único para el servicio, de manera que que pueda ser localizado por el cliente y el servidor./p>p styletext-align: justify;>Dentro de program, tenemos una version que es la que contiene los métodos. Esto es así porque RPC admite varias versiones de los métodos para un mismo programa (por motivos de compatibilidad hacia atrás, entre otros). En este caso tenemos una única (la 1)./p>p styletext-align: justify;>Las definiciones de las funciones son prácticamente iguales a las que haríamos en C, con una consideración adicional (para este caso): a la hora de devolver una cadena no devolvemos char*, sino string. El convenio de Sun que impone poner aquí los nombres de las funciones en mayúscula. Si devolvemos un operando definido, simplemente se escribe antes del nombre de la función (hora). Por tanto, una vez terminada esta parte, he definido un servicio con una primitiva que devuelve la hora./p>h2 styletext-align: justify;>Implementación del servidor/h2>p styletext-align: justify;>El siguiente paso es la implementación del servidor; necesitamos crear el código que se ejecutará efectivamente en la máquina remota. Lo bueno de este sistema es que podemos hacer esencialmente lo que queramos: consultar bases de datos, reaizar cálculos, invocar otros servicios remotos, etc. De este modo, los procedimientos RPC pueden ser usados como rutinas de computación, de administración/gestion u obtención de datos./p>p styletext-align: justify;>En este caso, por tener un ejemplo concreto, la implementación en sí de esas funciones es trivial. Lo que interesa ahora es la sintaxis (su significado), la manera en que se nos ofrecen los datos y cómo devolver nuestros resultados. El siguiente código utiliza la primera definición de XDR (sin operandos definidos)/p>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>12345678910111213141516171819/pre>/td>td classcode>pre classc stylefont-family:monospace;>span stylecolor: #339933;>#include <rpc/rpc.h>/span>span stylecolor: #339933;>#include "time.h"/span> span stylecolor: #993333;>char/span> span stylecolor: #339933;>**/span>hora_1_svcspan stylecolor: #009900;>(/span>span stylecolor: #993333;>struct/span> svc_req span stylecolor: #339933;>*/span>rqstpspan stylecolor: #009900;>)/span> span stylecolor: #009900;>{/span> span stylecolor: #993333;>static/span> span stylecolor: #993333;>long/span> timevalspan stylecolor: #339933;>;/span> span stylecolor: #666666; font-style: italic;>// debe ser una variable estática/span> span stylecolor: #993333;>static/span> span stylecolor: #993333;>char/span> span stylecolor: #339933;>*/span>ptrspan stylecolor: #339933;>;/span> span stylecolor: #666666; font-style: italic;>// debe ser una variable estática/span> timeval span stylecolor: #339933;>/span> span stylecolor: #000066;>time/span>span stylecolor: #009900;>(/span>span stylecolor: #009900;>(/span>span stylecolor: #993333;>long/span> span stylecolor: #339933;>*/span>span stylecolor: #009900;>)/span> span stylecolor: #0000dd;>0/span>span stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span> ptr span stylecolor: #339933;>/span> span stylecolor: #000066;>ctime/span>span stylecolor: #009900;>(/span>span stylecolor: #339933;>&/span>timevalspan stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span> span stylecolor: #b1b100;>return/span>span stylecolor: #009900;>(/span>span stylecolor: #339933;>&/span>ptrspan stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span>span stylecolor: #009900;>}/span> span stylecolor: #993333;>int/span> hora_prog_1_freeresultspan stylecolor: #009900;>(/span>SVCXPRT span stylecolor: #339933;>*/span>transpspan stylecolor: #339933;>,/span> xdrproc_t xdr_resultspan stylecolor: #339933;>,/span> caddr_t resultspan stylecolor: #009900;>)/span> span stylecolor: #009900;>{/span> xdr_freespan stylecolor: #009900;>(/span>xdr_resultspan stylecolor: #339933;>,/span> resultspan stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span> span stylecolor: #b1b100;>return/span> span stylecolor: #009900;>(/span>span stylecolor: #0000dd;>1/span>span stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span>span stylecolor: #009900;>}/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>#include <rpc/rpc.h>#include "time.h"char **hora_1_svc(struct svc_req *rqstp) { static long timeval; // debe ser una variable estática static char *ptr; // debe ser una variable estática timeval time((long *) 0); ptr ctime(&timeval); return(&ptr);}int hora_prog_1_freeresult(SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) { xdr_free(xdr_result, result); return (1);}/p>/div>p styletext-align: justify;>El tipo de retorno es un puntero al tipo que habíamos definido en el XDR (notar que stringchar*). Además, a la hora de devolver, devolvemos referencias a datos estáticos (ya que si devolviésemos referencias a la pila éstas no serían válidas al salir de la función). Este comportamiento es configurable en las opciones de rpcgen./p>p styletext-align: justify;>El tipo de los argumentos pueden ser también punteros a los tipos originales (Operandos) (no hay en el código de arriba), y además se añade un nuevo parámetro que es siempre struct svc_req*. El motivo de lo primero tiene que ver con cómo nos llegan los datos remotos (y con cómo los podemos modificar). El segundo parámetro contiene información sobre la petición que nos han hecho y el cliente que la ha realizado./p>p styletext-align: justify;>Con respecto al nombre de las funciones, estas se corresponden con el nombre descrito en el fichero XDR, añadiendo _i_svc, donde i es el número de versión que estamos implementando. Esto es así porque podemos tener diferentes versiones de una misma función, y con este sistema evitamos colisiones en los nombres./p>h2 styletext-align: justify;>Implementación del cliente/h2>p styletext-align: justify;>Para completar la parte de implementación, tenemos que escribir un código de cliente que haga uso de los procedimientos remotos. Éste se escribe como un programa local normal, salvo por que hacemos llamadas a ciertas funciones que son las que se encargan de hacer el trabajo de RPC./p>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>123456789101112131415161718192021222324252627/pre>/td>td classcode>pre classc stylefont-family:monospace;>span stylecolor: #339933;>#include <rpc/rpc.h>/span>span stylecolor: #339933;>#include <stdio.h>/span>span stylecolor: #339933;>#include "hora.h"/span> span stylecolor: #993333;>int/span> mainspan stylecolor: #009900;>(/span>span stylecolor: #993333;>int/span> argcspan stylecolor: #339933;>,/span> span stylecolor: #993333;>char/span> span stylecolor: #339933;>*/span>argvspan stylecolor: #009900;>[/span>span stylecolor: #009900;>]/span>span stylecolor: #009900;>)/span>span stylecolor: #009900;>{/span> CLIENT span stylecolor: #339933;>*/span>clspan stylecolor: #339933;>;/span> span stylecolor: #993333;>char/span> span stylecolor: #339933;>*/span>nombre_servidorspan stylecolor: #339933;>;/span> span stylecolor: #993333;>char/span> span stylecolor: #339933;>**/span>horaspan stylecolor: #339933;>;/span> span stylecolor: #b1b100;>if/span>span stylecolor: #009900;>(/span>argc span stylecolor: #339933;></span> span stylecolor: #0000dd;>2/span>span stylecolor: #009900;>)/span>span stylecolor: #009900;>{/span> span stylecolor: #000066;>perror/span>span stylecolor: #009900;>(/span>span stylecolor: #ff0000;>"Uso: ./client nombreservidor"/span>span stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span> span stylecolor: #009900;>}/span> nombre_servidor span stylecolor: #339933;>/span> argvspan stylecolor: #009900;>[/span>span stylecolor: #0000dd;>1/span>span stylecolor: #009900;>]/span>span stylecolor: #339933;>;/span> cl span stylecolor: #339933;>/span> clnt_createspan stylecolor: #009900;>(/span>nombre_servidorspan stylecolor: #339933;>,/span> HORA_PROGspan stylecolor: #339933;>,/span> HORA_VERSspan stylecolor: #339933;>,/span> span stylecolor: #ff0000;>"tcp"/span>span stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span> span stylecolor: #b1b100;>if/span>span stylecolor: #009900;>(/span>span stylecolor: #009900;>(/span>hora span stylecolor: #339933;>/span> hora_1span stylecolor: #009900;>(/span>NULLspan stylecolor: #339933;>,/span> clspan stylecolor: #009900;>)/span>span stylecolor: #009900;>)/span> span stylecolor: #339933;>/span> NULLspan stylecolor: #009900;>)/span> span stylecolor: #009900;>{/span> clnt_sperrorspan stylecolor: #009900;>(/span>clspan stylecolor: #339933;>,/span> argvspan stylecolor: #009900;>[/span>span stylecolor: #0000dd;>1/span>span stylecolor: #009900;>]/span>span stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span> span stylecolor: #009900;>}/span> span stylecolor: #000066;>printf/span>span stylecolor: #009900;>(/span>span stylecolor: #ff0000;>"span stylecolor: #000099; font-weight: bold;>\n/span>La hora del servidor %s es %s"/span>span stylecolor: #339933;>,/span> nombre_servidorspan stylecolor: #339933;>,/span> span stylecolor: #339933;>*/span>horaspan stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span> clnt_destroyspan stylecolor: #009900;>(/span>clspan stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span> span stylecolor: #000066;>exit/span>span stylecolor: #009900;>(/span>span stylecolor: #0000dd;>0/span>span stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span>span stylecolor: #009900;>}/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>#include <rpc/rpc.h>#include <stdio.h>#include "hora.h"int main(int argc, char *argv){ CLIENT *cl; char *nombre_servidor; char **hora; if(argc < 2){ perror("Uso: ./client nombreservidor"); } nombre_servidor argv1; cl clnt_create(nombre_servidor, HORA_PROG, HORA_VERS, "tcp"); if((hora hora_1(NULL, cl)) NULL) { clnt_sperror(cl, argv1); } printf("\nLa hora del servidor %s es %s", nombre_servidor, *hora); clnt_destroy(cl); exit(0);}/p>/div>p>El #include se hace sobre un fichero que todavía no hemos creado, hora.h. Éste se genera automáticamente con el comando rpcgen, y suele ser el nombre del fichero .x intercambiando la extensión./p>p>La instanciación se hace con la sentencia/p>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>1/pre>/td>td classcode>pre classc stylefont-family:monospace;>cl span stylecolor: #339933;>/span> clnt_createspan stylecolor: #009900;>(/span>nombre_servidorspan stylecolor: #339933;>,/span> HORA_PROGspan stylecolor: #339933;>,/span> HORA_VERSspan stylecolor: #339933;>,/span> span stylecolor: #ff0000;>"tcp"/span>span stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>cl clnt_create(nombre_servidor, HORA_PROG, HORA_VERS, "tcp");/p>/div>p styletext-align: justify;>Esta llamada devuelve un stub, que es una estructura con toda la información que necesita nuestra biblioteca de rpc. Los parámetros que admiten son el nombre de host del servidor (localhost si hacéis las pruebas en modo local, o una ip, y dos constantes que básicamente tienen que ser el nombre que pusimos después de program y después de version en el fichero .x del principio. El último parámetro indica el protocolo de transporte que queremos usar para nuestra petición./p>p styletext-align: justify;>Las llamadas en sí son muy sencillas, y utilizan exactamente el mismo interfaz que implementamos en el servidor. El segundo parámetro es el stub del cliente. Como esta función no tiene parámetros, se introduce NULL./p>h2>/h2>h2>Compilación/h2>p>rpcgen es un programa que toma como argumentos un fichero .x y genera el código de los stubs./p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #666666;>$ /span>rpcgen hora.x/pre>/td>/tr>/table>p classtheCode styledisplay:none;>$ rpcgen hora.x/p>/div>p>Esta línea ha debido generar los siguientes ficheros: hora.h, hora_svc.c, hora_clnt.c y hora_xdr.c (en el caso de haber definido una estructura de operandos en el XDR)./p>p styletext-align: justify;>El primero, hora.h, están las definiciones de tipos, constantes y funciones generales comunes tanto al servidor como al cliente. Es por eso por lo que hemos hecho el include en nuestras implementaciones./p>p styletext-align: justify;>Los ficheros hora_clnt.c y hora_svc.c contienen respectivamente el código los stubs de cliente y de servidor. Dichos stubs son los que se encargan efectivamente de que la comunicación sea transparente: transforman los argumentos y retornos que usamos en las funciones publicadas como servicios y también las decodifican en el otro extremo./p>p styletext-align: justify;>hora_xdr.c es el módulo que contiene información sobre los tipos que ha definido el usuario. Como sólo hemos utilizado tipos básicos, no ha hecho falta./p>p styletext-align: justify;>Lo único que falta es compilar el programa cliente y el servidor como si de cualquier otro programa se tratase. Para el cliente, como hemos hecho una implementación en C, usamos gcc como compilador:/p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #666666;>$ /span>span stylecolor: #c20cb9; font-weight: bold;>gcc/span> client.c hora_clnt.c span stylecolor: #660033;>-o/span> client/pre>/td>/tr>/table>p classtheCode styledisplay:none;>$ gcc client.c hora_clnt.c -o client/p>/div>p>Para el servidor:/p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #666666;>$ /span>span stylecolor: #c20cb9; font-weight: bold;>gcc/span> server.c hora_svc.c span stylecolor: #660033;>-o/span> server/pre>/td>/tr>/table>p classtheCode styledisplay:none;>$ gcc server.c hora_svc.c -o server/p>/div>h2>Ejecución/h2>p>Si todo lo anterior ha ido bien, basta con ejecutar el servidor:/p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #666666;>$ /span>.span stylecolor: #000000; font-weight: bold;>//span>server/pre>/td>/tr>/table>p classtheCode styledisplay:none;>$ ./server/p>/div>p>y ejecutar el cliente:/p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>$ .span stylecolor: #000000; font-weight: bold;>//span>client localhostLa hora del servidor localhost es Thu Jul span stylecolor: #000000;>21/span> span stylecolor: #000000;>17/span>:span stylecolor: #000000;>31/span>:span stylecolor: #000000;>56/span> span stylecolor: #000000;>2011/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>$ ./client localhostLa hora del servidor localhost es Thu Jul 21 17:31:56 2011/p>/div>p> /p>h2>Nota/h2>p>En recientes versiones de Ubuntu, tras ejecutar el servidor se obtiene un mensaje como este:/p>p>Cannot register service: RPC: Unable to receive; errno Connection refusedbr />unable to register (HORA_PROG, HORA_VERS, udp)./p>p>Esto es porque es necesario instalar el paquete portmap, lo cual puede realizarse con el siguiente comando en consola:/p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #c20cb9; font-weight: bold;>sudo/span> span stylecolor: #c20cb9; font-weight: bold;>apt-get install/span> portmap/pre>/td>/tr>/table>p classtheCode styledisplay:none;>sudo apt-get install portmap/p>/div>p>Espero que el tema os haya gustado. Dejo abajo el enlace al código del ejemplo./p>figure idattachment_156 aria-describedbycaption-attachment-156 stylewidth: 46px classwp-caption alignleft>a hrefhttp://davidlopez.es/wp-content/uploads/2016/04/rpc_time.tar.gz>img loadinglazy classwp-image-156 size-full srchttp://davidlopez.es/wp-content/uploads/2016/04/archive.png altrpc_time.tar.gz width46 height60 />/a>figcaption idcaption-attachment-156 classwp-caption-text>code/figcaption>/figure> /div>!-- .entry-content --> /article>!-- #post-134 --> /main>!-- #main --> /div>!-- #primary --> aside idsecondary classwidget-area rolecomplementary aria-labelBarra lateral del blog> section idcategories-4 classwidget widget_categories>h2 classwidget-title>Categorías/h2>nav rolenavigation aria-labelCategorías> ul> li classcat-item cat-item-20>a hrefhttps://davidlopez.es/category/internet/>Internet/a>/li> li classcat-item cat-item-11>a hrefhttps://davidlopez.es/category/programacion/>Programación/a>/li> li classcat-item cat-item-1>a hrefhttps://davidlopez.es/category/sin-categoria/>Sin categoría/a>/li> li classcat-item cat-item-16>a hrefhttps://davidlopez.es/category/sistemas-operativos/>Sistemas operativos/a>/li> /ul> /nav>/section>section idtag_cloud-7 classwidget widget_tag_cloud>h2 classwidget-title>Etiquetas/h2>nav rolenavigation aria-labelEtiquetas>div classtagcloud>ul classwp-tag-cloud rolelist> li>a hrefhttps://davidlopez.es/tag/boot/ classtag-cloud-link tag-link-18 tag-link-position-1 stylefont-size: 1em;>boot/a>/li> li>a hrefhttps://davidlopez.es/tag/client/ classtag-cloud-link tag-link-15 tag-link-position-2 stylefont-size: 1em;>client/a>/li> li>a hrefhttps://davidlopez.es/tag/corba/ classtag-cloud-link tag-link-22 tag-link-position-3 stylefont-size: 1em;>CORBA/a>/li> li>a hrefhttps://davidlopez.es/tag/ftp/ classtag-cloud-link tag-link-21 tag-link-position-4 stylefont-size: 1em;>ftp/a>/li> li>a hrefhttps://davidlopez.es/tag/grub/ classtag-cloud-link tag-link-17 tag-link-position-5 stylefont-size: 1em;>grub/a>/li> li>a hrefhttps://davidlopez.es/tag/orb/ classtag-cloud-link tag-link-23 tag-link-position-6 stylefont-size: 1em;>ORB/a>/li> li>a hrefhttps://davidlopez.es/tag/rpc/ classtag-cloud-link tag-link-12 tag-link-position-7 stylefont-size: 1em;>rpc/a>/li> li>a hrefhttps://davidlopez.es/tag/server/ classtag-cloud-link tag-link-14 tag-link-position-8 stylefont-size: 1em;>server/a>/li> li>a hrefhttps://davidlopez.es/tag/sistemas-operativos/ classtag-cloud-link tag-link-19 tag-link-position-9 stylefont-size: 1em;>sistemas operativos/a>/li> li>a hrefhttps://davidlopez.es/tag/xdr/ classtag-cloud-link tag-link-13 tag-link-position-10 stylefont-size: 1em;>XDR/a>/li>/ul>/div>/nav>/section>section idtwitter-timeline-profile-2 classwidget widget_twitter-timeline-profile>h2 classwidget-title>Twitter DLopez_87/h2>div classtwitter-timeline-profile>a classtwitter-timeline data-langes hrefhttps://twitter.com/DLopez_87?ref_srctwsrc%5Etfw>Tweets by DLopez_87/a>/div>/section>/aside>!-- #secondary -->/div>!-- .wrap --> /div>!-- #content --> footer idcolophon classsite-footer rolecontentinfo> div classwrap> div classsite-info> a hrefhttps://es.wordpress.org/ classimprint> Funciona gracias a WordPress /a>/div>!-- .site-info --> /div>!-- .wrap --> /footer>!-- #colophon --> /div>!-- .site-content-contain -->/div>!-- #page -->link relstylesheet idsgmb_socialFont_style-css hrefhttp://davidlopez.es/wp-content/plugins/social-media-builder/css/jssocial/font-awesome.min.css?ver5.6.14 mediaall />link relstylesheet idsgmb_social2_style-css hrefhttp://davidlopez.es/wp-content/plugins/social-media-builder/css/jssocial/jssocials.css?ver5.6.14 mediaall />link relstylesheet idjssocials_theme_minima-css hrefhttp://davidlopez.es/wp-content/plugins/social-media-builder/css/jssocial/jssocials-theme-minima.css?ver5.6.14 mediaall />link relstylesheet idsgmb_widget_style-css hrefhttp://davidlopez.es/wp-content/plugins/social-media-builder/css/widget/widget-style.css?ver5.6.14 mediaall />link relstylesheet idsgmb_buttons_animate-css hrefhttp://davidlopez.es/wp-content/plugins/social-media-builder/css/animate.css?ver5.6.14 mediaall />link relstylesheet idsgmb_drop_down_style-css hrefhttp://davidlopez.es/wp-content/plugins/social-media-builder/css/widget/simple.dropdown.css?ver5.6.14 mediaall />script idcontact-form-7-js-extra>var wpcf7 {apiSettings:{root:https:\/\/davidlopez.es\/wp-json\/contact-form-7\/v1,namespace:contact-form-7\/v1}};/script>script srchttp://davidlopez.es/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver5.3.2 idcontact-form-7-js>/script>script srchttps://www.google.com/recaptcha/api.js?render6LfqfrgUAAAAAFOUHaSkZijWiYuafSgQjcIzWP8k&ver3.0 idgoogle-recaptcha-js>/script>script idwpcf7-recaptcha-js-extra>var wpcf7_recaptcha {sitekey:6LfqfrgUAAAAAFOUHaSkZijWiYuafSgQjcIzWP8k,actions:{homepage:homepage,contactform:contactform}};/script>script srchttp://davidlopez.es/wp-content/plugins/contact-form-7/modules/recaptcha/script.js?ver5.3.2 idwpcf7-recaptcha-js>/script>script srchttp://davidlopez.es/wp-content/plugins/wp-syntax/js/wp-syntax.js?ver1.1 idwp-syntax-js-js>/script>script idtwentyseventeen-skip-link-focus-fix-js-extra>var twentyseventeenScreenReaderText {quote:svg class\icon icon-quote-right\ aria-hidden\true\ role\img\> use href\#icon-quote-right\ xlink:href\#icon-quote-right\>\/use> \/svg>,expand:Expandir el men\u00fa inferior,collapse:Cerrar el men\u00fa inferior,icon:svg class\icon icon-angle-down\ aria-hidden\true\ role\img\> use href\#icon-angle-down\ xlink:href\#icon-angle-down\>\/use> span class\svg-fallback icon-angle-down\>\/span>\/svg>};/script>script srchttp://davidlopez.es/wp-content/themes/twentyseventeen/assets/js/skip-link-focus-fix.js?ver20161114 idtwentyseventeen-skip-link-focus-fix-js>/script>script srchttp://davidlopez.es/wp-content/themes/twentyseventeen/assets/js/navigation.js?ver20161203 idtwentyseventeen-navigation-js>/script>script srchttp://davidlopez.es/wp-content/themes/twentyseventeen/assets/js/global.js?ver20190121 idtwentyseventeen-global-js>/script>script srchttp://davidlopez.es/wp-content/themes/twentyseventeen/assets/js/jquery.scrollTo.js?ver2.1.2 idjquery-scrollto-js>/script>script idtwitter-wjs-js-extra>window.twttr(function(w){tw.twttr||{};t._e;t.readyfunction(f){t._e.push(f);};return t;}(window));/script>script typetext/javascript idtwitter-wjs async defer srchttps://platform.twitter.com/widgets.js charsetutf-8>/script>script srchttp://davidlopez.es/wp-includes/js/wp-embed.min.js?ver5.6.14 idwp-embed-js>/script>script srchttp://davidlopez.es/wp-content/plugins/social-media-builder/js/addNewSection/SGMB.js idsgmb-class-sgmb-js>/script>script srchttp://davidlopez.es/wp-content/plugins/social-media-builder/js/addNewSection/SGMBWidget.js idsgmb-class-sgmbWidget-js>/script>script srchttp://davidlopez.es/wp-content/plugins/social-media-builder/js/jssocials.js idsgmb-jssocial1-scripts-js>/script>script srchttp://davidlopez.es/wp-content/plugins/social-media-builder/js/jssocials.shares.js idsgmb-jssocial2-scripts-js>/script>script srchttp://davidlopez.es/wp-content/plugins/social-media-builder/js/simple.dropdown.js idsgmb-drop_down-scripts-js>/script>svg styleposition: absolute; width: 0; height: 0; overflow: hidden; version1.1 xmlnshttp://www.w3.org/2000/svg xmlns:xlinkhttp://www.w3.org/1999/xlink>defs>symbol idicon-behance viewBox0 0 37 32>path classpath1 dM33 6.054h-9.125v2.214h9.125v-2.214zM28.5 13.661q-1.607 0-2.607 0.938t-1.107 2.545h7.286q-0.321-3.482-3.571-3.482zM28.786 24.107q1.125 0 2.179-0.571t1.357-1.554h3.946q-1.786 5.482-7.625 5.482-3.821 0-6.080-2.357t-2.259-6.196q0-3.714 2.33-6.17t6.009-2.455q2.464 0 4.295 1.214t2.732 3.196 0.902 4.429q0 0.304-0.036 0.839h-11.75q0 1.982 1.027 3.063t2.973 1.080zM4.946 23.214h5.286q3.661 0 3.661-2.982 0-3.214-3.554-3.214h-5.393v6.196zM4.946 13.625h5.018q1.393 0 2.205-0.652t0.813-2.027q0-2.571-3.393-2.571h-4.643v5.25zM0 4.536h10.607q1.554 0 2.768 0.25t2.259 0.848 1.607 1.723 0.563 2.75q0 3.232-3.071 4.696 2.036 0.571 3.071 2.054t1.036 3.643q0 1.339-0.438 2.438t-1.179 1.848-1.759 1.268-2.161 0.75-2.393 0.232h-10.911v-22.5z>/path>/symbol>symbol idicon-deviantart viewBox0 0 18 32>path classpath1 dM18.286 5.411l-5.411 10.393 0.429 0.554h4.982v7.411h-9.054l-0.786 0.536-2.536 4.875-0.536 0.536h-5.375v-5.411l5.411-10.411-0.429-0.536h-4.982v-7.411h9.054l0.786-0.536 2.536-4.875 0.536-0.536h5.375v5.411z>/path>/symbol>symbol idicon-medium viewBox0 0 32 32>path classpath1 dM10.661 7.518v20.946q0 0.446-0.223 0.759t-0.652 0.313q-0.304 0-0.589-0.143l-8.304-4.161q-0.375-0.179-0.634-0.598t-0.259-0.83v-20.357q0-0.357 0.179-0.607t0.518-0.25q0.25 0 0.786 0.268l9.125 4.571q0.054 0.054 0.054 0.089zM11.804 9.321l9.536 15.464-9.536-4.75v-10.714zM32 9.643v18.821q0 0.446-0.25 0.723t-0.679 0.277-0.839-0.232l-7.875-3.929zM31.946 7.5q0 0.054-4.58 7.491t-5.366 8.705l-6.964-11.321 5.786-9.411q0.304-0.5 0.929-0.5 0.25 0 0.464 0.107l9.661 4.821q0.071 0.036 0.071 0.107z>/path>/symbol>symbol idicon-slideshare viewBox0 0 32 32>path classpath1 dM15.589 13.214q0 1.482-1.134 2.545t-2.723 1.063-2.723-1.063-1.134-2.545q0-1.5 1.134-2.554t2.723-1.054 2.723 1.054 1.134 2.554zM24.554 13.214q0 1.482-1.125 2.545t-2.732 1.063q-1.589 0-2.723-1.063t-1.134-2.545q0-1.5 1.134-2.554t2.723-1.054q1.607 0 2.732 1.054t1.125 2.554zM28.571 16.429v-11.911q0-1.554-0.571-2.205t-1.982-0.652h-19.857q-1.482 0-2.009 0.607t-0.527 2.25v12.018q0.768 0.411 1.58 0.714t1.446 0.5 1.446 0.33 1.268 0.196 1.25 0.071 1.045 0.009 1.009-0.036 0.795-0.036q1.214-0.018 1.696 0.482 0.107 0.107 0.179 0.161 0.464 0.446 1.089 0.911 0.125-1.625 2.107-1.554 0.089 0 0.652 0.027t0.768 0.036 0.813 0.018 0.946-0.018 0.973-0.080 1.089-0.152 1.107-0.241 1.196-0.348 1.205-0.482 1.286-0.616zM31.482 16.339q-2.161 2.661-6.643 4.5 1.5 5.089-0.411 8.304-1.179 2.018-3.268 2.643-1.857 0.571-3.25-0.268-1.536-0.911-1.464-2.929l-0.018-5.821v-0.018q-0.143-0.036-0.438-0.107t-0.42-0.089l-0.018 6.036q0.071 2.036-1.482 2.929-1.411 0.839-3.268 0.268-2.089-0.643-3.25-2.679-1.875-3.214-0.393-8.268-4.482-1.839-6.643-4.5-0.446-0.661-0.071-1.125t1.071 0.018q0.054 0.036 0.196 0.125t0.196 0.143v-12.393q0-1.286 0.839-2.196t2.036-0.911h22.446q1.196 0 2.036 0.911t0.839 2.196v12.393l0.375-0.268q0.696-0.482 1.071-0.018t-0.071 1.125z>/path>/symbol>symbol idicon-snapchat-ghost viewBox0 0 30 32>path classpath1 dM15.143 2.286q2.393-0.018 4.295 1.223t2.92 3.438q0.482 1.036 0.482 3.196 0 0.839-0.161 3.411 0.25 0.125 0.5 0.125 0.321 0 0.911-0.241t0.911-0.241q0.518 0 1 0.321t0.482 0.821q0 0.571-0.563 0.964t-1.232 0.563-1.232 0.518-0.563 0.848q0 0.268 0.214 0.768 0.661 1.464 1.83 2.679t2.58 1.804q0.5 0.214 1.429 0.411 0.5 0.107 0.5 0.625 0 1.25-3.911 1.839-0.125 0.196-0.196 0.696t-0.25 0.83-0.589 0.33q-0.357 0-1.107-0.116t-1.143-0.116q-0.661 0-1.107 0.089-0.571 0.089-1.125 0.402t-1.036 0.679-1.036 0.723-1.357 0.598-1.768 0.241q-0.929 0-1.723-0.241t-1.339-0.598-1.027-0.723-1.036-0.679-1.107-0.402q-0.464-0.089-1.125-0.089-0.429 0-1.17 0.134t-1.045 0.134q-0.446 0-0.625-0.33t-0.25-0.848-0.196-0.714q-3.911-0.589-3.911-1.839 0-0.518 0.5-0.625 0.929-0.196 1.429-0.411 1.393-0.571 2.58-1.804t1.83-2.679q0.214-0.5 0.214-0.768 0-0.5-0.563-0.848t-1.241-0.527-1.241-0.563-0.563-0.938q0-0.482 0.464-0.813t0.982-0.33q0.268 0 0.857 0.232t0.946 0.232q0.321 0 0.571-0.125-0.161-2.536-0.161-3.393 0-2.179 0.482-3.214 1.143-2.446 3.071-3.536t4.714-1.125z>/path>/symbol>symbol idicon-yelp viewBox0 0 27 32>path classpath1 dM13.804 23.554v2.268q-0.018 5.214-0.107 5.446-0.214 0.571-0.911 0.714-0.964 0.161-3.241-0.679t-2.902-1.589q-0.232-0.268-0.304-0.643-0.018-0.214 0.071-0.464 0.071-0.179 0.607-0.839t3.232-3.857q0.018 0 1.071-1.25 0.268-0.339 0.705-0.438t0.884 0.063q0.429 0.179 0.67 0.518t0.223 0.75zM11.143 19.071q-0.054 0.982-0.929 1.25l-2.143 0.696q-4.911 1.571-5.214 1.571-0.625-0.036-0.964-0.643-0.214-0.446-0.304-1.339-0.143-1.357 0.018-2.973t0.536-2.223 1-0.571q0.232 0 3.607 1.375 1.25 0.518 2.054 0.839l1.5 0.607q0.411 0.161 0.634 0.545t0.205 0.866zM25.893 24.375q-0.125 0.964-1.634 2.875t-2.42 2.268q-0.661 0.25-1.125-0.125-0.25-0.179-3.286-5.125l-0.839-1.375q-0.25-0.375-0.205-0.821t0.348-0.821q0.625-0.768 1.482-0.464 0.018 0.018 2.125 0.714 3.625 1.179 4.321 1.42t0.839 0.366q0.5 0.393 0.393 1.089zM13.893 13.089q0.089 1.821-0.964 2.179-1.036 0.304-2.036-1.268l-6.75-10.679q-0.143-0.625 0.339-1.107 0.732-0.768 3.705-1.598t4.009-0.563q0.714 0.179 0.875 0.804 0.054 0.321 0.393 5.455t0.429 6.777zM25.714 15.018q0.054 0.696-0.464 1.054-0.268 0.179-5.875 1.536-1.196 0.268-1.625 0.411l0.018-0.036q-0.411 0.107-0.821-0.071t-0.661-0.571q-0.536-0.839 0-1.554 0.018-0.018 1.339-1.821 2.232-3.054 2.679-3.643t0.607-0.696q0.5-0.339 1.161-0.036 0.857 0.411 2.196 2.384t1.446 2.991v0.054z>/path>/symbol>symbol idicon-vine viewBox0 0 27 32>path classpath1 dM26.732 14.768v3.536q-1.804 0.411-3.536 0.411-1.161 2.429-2.955 4.839t-3.241 3.848-2.286 1.902q-1.429 0.804-2.893-0.054-0.5-0.304-1.080-0.777t-1.518-1.491-1.83-2.295-1.92-3.286-1.884-4.357-1.634-5.616-1.259-6.964h5.054q0.464 3.893 1.25 7.116t1.866 5.661 2.17 4.205 2.5 3.482q3.018-3.018 5.125-7.25-2.536-1.286-3.982-3.929t-1.446-5.946q0-3.429 1.857-5.616t5.071-2.188q3.179 0 4.875 1.884t1.696 5.313q0 2.839-1.036 5.107-0.125 0.018-0.348 0.054t-0.821 0.036-1.125-0.107-1.107-0.455-0.902-0.92q0.554-1.839 0.554-3.286 0-1.554-0.518-2.357t-1.411-0.804q-0.946 0-1.518 0.884t-0.571 2.509q0 3.321 1.875 5.241t4.768 1.92q1.107 0 2.161-0.25z>/path>/symbol>symbol idicon-vk viewBox0 0 35 32>path classpath1 dM34.232 9.286q0.411 1.143-2.679 5.25-0.429 0.571-1.161 1.518-1.393 1.786-1.607 2.339-0.304 0.732 0.25 1.446 0.304 0.375 1.446 1.464h0.018l0.071 0.071q2.518 2.339 3.411 3.946 0.054 0.089 0.116 0.223t0.125 0.473-0.009 0.607-0.446 0.491-1.054 0.223l-4.571 0.071q-0.429 0.089-1-0.089t-0.929-0.393l-0.357-0.214q-0.536-0.375-1.25-1.143t-1.223-1.384-1.089-1.036-1.009-0.277q-0.054 0.018-0.143 0.063t-0.304 0.259-0.384 0.527-0.304 0.929-0.116 1.384q0 0.268-0.063 0.491t-0.134 0.33l-0.071 0.089q-0.321 0.339-0.946 0.393h-2.054q-1.268 0.071-2.607-0.295t-2.348-0.946-1.839-1.179-1.259-1.027l-0.446-0.429q-0.179-0.179-0.491-0.536t-1.277-1.625-1.893-2.696-2.188-3.768-2.33-4.857q-0.107-0.286-0.107-0.482t0.054-0.286l0.071-0.107q0.268-0.339 1.018-0.339l4.893-0.036q0.214 0.036 0.411 0.116t0.286 0.152l0.089 0.054q0.286 0.196 0.429 0.571 0.357 0.893 0.821 1.848t0.732 1.455l0.286 0.518q0.518 1.071 1 1.857t0.866 1.223 0.741 0.688 0.607 0.25 0.482-0.089q0.036-0.018 0.089-0.089t0.214-0.393 0.241-0.839 0.17-1.446 0-2.232q-0.036-0.714-0.161-1.304t-0.25-0.821l-0.107-0.214q-0.446-0.607-1.518-0.768-0.232-0.036 0.089-0.429 0.304-0.339 0.679-0.536 0.946-0.464 4.268-0.429 1.464 0.018 2.411 0.232 0.357 0.089 0.598 0.241t0.366 0.429 0.188 0.571 0.063 0.813-0.018 0.982-0.045 1.259-0.027 1.473q0 0.196-0.018 0.75t-0.009 0.857 0.063 0.723 0.205 0.696 0.402 0.438q0.143 0.036 0.304 0.071t0.464-0.196 0.679-0.616 0.929-1.196 1.214-1.92q1.071-1.857 1.911-4.018 0.071-0.179 0.179-0.313t0.196-0.188l0.071-0.054 0.089-0.045t0.232-0.054 0.357-0.009l5.143-0.036q0.696-0.089 1.143 0.045t0.554 0.295z>/path>/symbol>symbol idicon-search viewBox0 0 30 32>path classpath1 dM20.571 14.857q0-3.304-2.348-5.652t-5.652-2.348-5.652 2.348-2.348 5.652 2.348 5.652 5.652 2.348 5.652-2.348 2.348-5.652zM29.714 29.714q0 0.929-0.679 1.607t-1.607 0.679q-0.964 0-1.607-0.679l-6.125-6.107q-3.196 2.214-7.125 2.214-2.554 0-4.884-0.991t-4.018-2.679-2.679-4.018-0.991-4.884 0.991-4.884 2.679-4.018 4.018-2.679 4.884-0.991 4.884 0.991 4.018 2.679 2.679 4.018 0.991 4.884q0 3.929-2.214 7.125l6.125 6.125q0.661 0.661 0.661 1.607z>/path>/symbol>symbol idicon-envelope-o viewBox0 0 32 32>path classpath1 dM29.714 26.857v-13.714q-0.571 0.643-1.232 1.179-4.786 3.679-7.607 6.036-0.911 0.768-1.482 1.196t-1.545 0.866-1.83 0.438h-0.036q-0.857 0-1.83-0.438t-1.545-0.866-1.482-1.196q-2.821-2.357-7.607-6.036-0.661-0.536-1.232-1.179v13.714q0 0.232 0.17 0.402t0.402 0.17h26.286q0.232 0 0.402-0.17t0.17-0.402zM29.714 8.089v-0.438t-0.009-0.232-0.054-0.223-0.098-0.161-0.161-0.134-0.25-0.045h-26.286q-0.232 0-0.402 0.17t-0.17 0.402q0 3 2.625 5.071 3.446 2.714 7.161 5.661 0.107 0.089 0.625 0.527t0.821 0.67 0.795 0.563 0.902 0.491 0.768 0.161h0.036q0.357 0 0.768-0.161t0.902-0.491 0.795-0.563 0.821-0.67 0.625-0.527q3.714-2.946 7.161-5.661 0.964-0.768 1.795-2.063t0.83-2.348zM32 7.429v19.429q0 1.179-0.839 2.018t-2.018 0.839h-26.286q-1.179 0-2.018-0.839t-0.839-2.018v-19.429q0-1.179 0.839-2.018t2.018-0.839h26.286q1.179 0 2.018 0.839t0.839 2.018z>/path>/symbol>symbol idicon-close viewBox0 0 25 32>path classpath1 dM23.179 23.607q0 0.714-0.5 1.214l-2.429 2.429q-0.5 0.5-1.214 0.5t-1.214-0.5l-5.25-5.25-5.25 5.25q-0.5 0.5-1.214 0.5t-1.214-0.5l-2.429-2.429q-0.5-0.5-0.5-1.214t0.5-1.214l5.25-5.25-5.25-5.25q-0.5-0.5-0.5-1.214t0.5-1.214l2.429-2.429q0.5-0.5 1.214-0.5t1.214 0.5l5.25 5.25 5.25-5.25q0.5-0.5 1.214-0.5t1.214 0.5l2.429 2.429q0.5 0.5 0.5 1.214t-0.5 1.214l-5.25 5.25 5.25 5.25q0.5 0.5 0.5 1.214z>/path>/symbol>symbol idicon-angle-down viewBox0 0 21 32>path classpath1 dM19.196 13.143q0 0.232-0.179 0.411l-8.321 8.321q-0.179 0.179-0.411 0.179t-0.411-0.179l-8.321-8.321q-0.179-0.179-0.179-0.411t0.179-0.411l0.893-0.893q0.179-0.179 0.411-0.179t0.411 0.179l7.018 7.018 7.018-7.018q0.179-0.179 0.411-0.179t0.411 0.179l0.893 0.893q0.179 0.179 0.179 0.411z>/path>/symbol>symbol idicon-folder-open viewBox0 0 34 32>path classpath1 dM33.554 17q0 0.554-0.554 1.179l-6 7.071q-0.768 0.911-2.152 1.545t-2.563 0.634h-19.429q-0.607 0-1.080-0.232t-0.473-0.768q0-0.554 0.554-1.179l6-7.071q0.768-0.911 2.152-1.545t2.563-0.634h19.429q0.607 0 1.080 0.232t0.473 0.768zM27.429 10.857v2.857h-14.857q-1.679 0-3.518 0.848t-2.929 2.134l-6.107 7.179q0-0.071-0.009-0.223t-0.009-0.223v-17.143q0-1.643 1.179-2.821t2.821-1.179h5.714q1.643 0 2.821 1.179t1.179 2.821v0.571h9.714q1.643 0 2.821 1.179t1.179 2.821z>/path>/symbol>symbol idicon-twitter viewBox0 0 30 32>path classpath1 dM28.929 7.286q-1.196 1.75-2.893 2.982 0.018 0.25 0.018 0.75 0 2.321-0.679 4.634t-2.063 4.437-3.295 3.759-4.607 2.607-5.768 0.973q-4.839 0-8.857-2.589 0.625 0.071 1.393 0.071 4.018 0 7.161-2.464-1.875-0.036-3.357-1.152t-2.036-2.848q0.589 0.089 1.089 0.089 0.768 0 1.518-0.196-2-0.411-3.313-1.991t-1.313-3.67v-0.071q1.214 0.679 2.607 0.732-1.179-0.786-1.875-2.054t-0.696-2.75q0-1.571 0.786-2.911 2.161 2.661 5.259 4.259t6.634 1.777q-0.143-0.679-0.143-1.321 0-2.393 1.688-4.080t4.080-1.688q2.5 0 4.214 1.821 1.946-0.375 3.661-1.393-0.661 2.054-2.536 3.179 1.661-0.179 3.321-0.893z>/path>/symbol>symbol idicon-facebook viewBox0 0 19 32>path classpath1 dM17.125 0.214v4.714h-2.804q-1.536 0-2.071 0.643t-0.536 1.929v3.375h5.232l-0.696 5.286h-4.536v13.554h-5.464v-13.554h-4.554v-5.286h4.554v-3.893q0-3.321 1.857-5.152t4.946-1.83q2.625 0 4.071 0.214z>/path>/symbol>symbol idicon-github viewBox0 0 27 32>path classpath1 dM13.714 2.286q3.732 0 6.884 1.839t4.991 4.991 1.839 6.884q0 4.482-2.616 8.063t-6.759 4.955q-0.482 0.089-0.714-0.125t-0.232-0.536q0-0.054 0.009-1.366t0.009-2.402q0-1.732-0.929-2.536 1.018-0.107 1.83-0.321t1.679-0.696 1.446-1.188 0.946-1.875 0.366-2.688q0-2.125-1.411-3.679 0.661-1.625-0.143-3.643-0.5-0.161-1.446 0.196t-1.643 0.786l-0.679 0.429q-1.661-0.464-3.429-0.464t-3.429 0.464q-0.286-0.196-0.759-0.482t-1.491-0.688-1.518-0.241q-0.804 2.018-0.143 3.643-1.411 1.554-1.411 3.679 0 1.518 0.366 2.679t0.938 1.875 1.438 1.196 1.679 0.696 1.83 0.321q-0.696 0.643-0.875 1.839-0.375 0.179-0.804 0.268t-1.018 0.089-1.17-0.384-0.991-1.116q-0.339-0.571-0.866-0.929t-0.884-0.429l-0.357-0.054q-0.375 0-0.518 0.080t-0.089 0.205 0.161 0.25 0.232 0.214l0.125 0.089q0.393 0.179 0.777 0.679t0.563 0.911l0.179 0.411q0.232 0.679 0.786 1.098t1.196 0.536 1.241 0.125 0.991-0.063l0.411-0.071q0 0.679 0.009 1.58t0.009 0.973q0 0.321-0.232 0.536t-0.714 0.125q-4.143-1.375-6.759-4.955t-2.616-8.063q0-3.732 1.839-6.884t4.991-4.991 6.884-1.839zM5.196 21.982q0.054-0.125-0.125-0.214-0.179-0.054-0.232 0.036-0.054 0.125 0.125 0.214 0.161 0.107 0.232-0.036zM5.75 22.589q0.125-0.089-0.036-0.286-0.179-0.161-0.286-0.054-0.125 0.089 0.036 0.286 0.179 0.179 0.286 0.054zM6.286 23.393q0.161-0.125 0-0.339-0.143-0.232-0.304-0.107-0.161 0.089 0 0.321t0.304 0.125zM7.036 24.143q0.143-0.143-0.071-0.339-0.214-0.214-0.357-0.054-0.161 0.143 0.071 0.339 0.214 0.214 0.357 0.054zM8.054 24.589q0.054-0.196-0.232-0.286-0.268-0.071-0.339 0.125t0.232 0.268q0.268 0.107 0.339-0.107zM9.179 24.679q0-0.232-0.304-0.196-0.286 0-0.286 0.196 0 0.232 0.304 0.196 0.286 0 0.286-0.196zM10.214 24.5q-0.036-0.196-0.321-0.161-0.286 0.054-0.25 0.268t0.321 0.143 0.25-0.25z>/path>/symbol>symbol idicon-bars viewBox0 0 27 32>path classpath1 dM27.429 24v2.286q0 0.464-0.339 0.804t-0.804 0.339h-25.143q-0.464 0-0.804-0.339t-0.339-0.804v-2.286q0-0.464 0.339-0.804t0.804-0.339h25.143q0.464 0 0.804 0.339t0.339 0.804zM27.429 14.857v2.286q0 0.464-0.339 0.804t-0.804 0.339h-25.143q-0.464 0-0.804-0.339t-0.339-0.804v-2.286q0-0.464 0.339-0.804t0.804-0.339h25.143q0.464 0 0.804 0.339t0.339 0.804zM27.429 5.714v2.286q0 0.464-0.339 0.804t-0.804 0.339h-25.143q-0.464 0-0.804-0.339t-0.339-0.804v-2.286q0-0.464 0.339-0.804t0.804-0.339h25.143q0.464 0 0.804 0.339t0.339 0.804z>/path>/symbol>symbol idicon-google-plus viewBox0 0 41 32>path classpath1 dM25.661 16.304q0 3.714-1.554 6.616t-4.429 4.536-6.589 1.634q-2.661 0-5.089-1.036t-4.179-2.786-2.786-4.179-1.036-5.089 1.036-5.089 2.786-4.179 4.179-2.786 5.089-1.036q5.107 0 8.768 3.429l-3.554 3.411q-2.089-2.018-5.214-2.018-2.196 0-4.063 1.107t-2.955 3.009-1.089 4.152 1.089 4.152 2.955 3.009 4.063 1.107q1.482 0 2.723-0.411t2.045-1.027 1.402-1.402 0.875-1.482 0.384-1.321h-7.429v-4.5h12.357q0.214 1.125 0.214 2.179zM41.143 14.125v3.75h-3.732v3.732h-3.75v-3.732h-3.732v-3.75h3.732v-3.732h3.75v3.732h3.732z>/path>/symbol>symbol idicon-linkedin viewBox0 0 27 32>path classpath1 dM6.232 11.161v17.696h-5.893v-17.696h5.893zM6.607 5.696q0.018 1.304-0.902 2.179t-2.42 0.875h-0.036q-1.464 0-2.357-0.875t-0.893-2.179q0-1.321 0.92-2.188t2.402-0.866 2.375 0.866 0.911 2.188zM27.429 18.714v10.143h-5.875v-9.464q0-1.875-0.723-2.938t-2.259-1.063q-1.125 0-1.884 0.616t-1.134 1.527q-0.196 0.536-0.196 1.446v9.875h-5.875q0.036-7.125 0.036-11.554t-0.018-5.286l-0.018-0.857h5.875v2.571h-0.036q0.357-0.571 0.732-1t1.009-0.929 1.554-0.777 2.045-0.277q3.054 0 4.911 2.027t1.857 5.938z>/path>/symbol>symbol idicon-quote-right viewBox0 0 30 32>path classpath1 dM13.714 5.714v12.571q0 1.857-0.723 3.545t-1.955 2.92-2.92 1.955-3.545 0.723h-1.143q-0.464 0-0.804-0.339t-0.339-0.804v-2.286q0-0.464 0.339-0.804t0.804-0.339h1.143q1.893 0 3.232-1.339t1.339-3.232v-0.571q0-0.714-0.5-1.214t-1.214-0.5h-4q-1.429 0-2.429-1t-1-2.429v-6.857q0-1.429 1-2.429t2.429-1h6.857q1.429 0 2.429 1t1 2.429zM29.714 5.714v12.571q0 1.857-0.723 3.545t-1.955 2.92-2.92 1.955-3.545 0.723h-1.143q-0.464 0-0.804-0.339t-0.339-0.804v-2.286q0-0.464 0.339-0.804t0.804-0.339h1.143q1.893 0 3.232-1.339t1.339-3.232v-0.571q0-0.714-0.5-1.214t-1.214-0.5h-4q-1.429 0-2.429-1t-1-2.429v-6.857q0-1.429 1-2.429t2.429-1h6.857q1.429 0 2.429 1t1 2.429z>/path>/symbol>symbol idicon-mail-reply viewBox0 0 32 32>path classpath1 dM32 20q0 2.964-2.268 8.054-0.054 0.125-0.188 0.429t-0.241 0.536-0.232 0.393q-0.214 0.304-0.5 0.304-0.268 0-0.42-0.179t-0.152-0.446q0-0.161 0.045-0.473t0.045-0.42q0.089-1.214 0.089-2.196 0-1.804-0.313-3.232t-0.866-2.473-1.429-1.804-1.884-1.241-2.375-0.759-2.75-0.384-3.134-0.107h-4v4.571q0 0.464-0.339 0.804t-0.804 0.339-0.804-0.339l-9.143-9.143q-0.339-0.339-0.339-0.804t0.339-0.804l9.143-9.143q0.339-0.339 0.804-0.339t0.804 0.339 0.339 0.804v4.571h4q12.732 0 15.625 7.196 0.946 2.393 0.946 5.946z>/path>/symbol>symbol idicon-youtube viewBox0 0 27 32>path classpath1 dM17.339 22.214v3.768q0 1.196-0.696 1.196-0.411 0-0.804-0.393v-5.375q0.393-0.393 0.804-0.393 0.696 0 0.696 1.196zM23.375 22.232v0.821h-1.607v-0.821q0-1.214 0.804-1.214t0.804 1.214zM6.125 18.339h1.911v-1.679h-5.571v1.679h1.875v10.161h1.786v-10.161zM11.268 28.5h1.589v-8.821h-1.589v6.75q-0.536 0.75-1.018 0.75-0.321 0-0.375-0.375-0.018-0.054-0.018-0.625v-6.5h-1.589v6.982q0 0.875 0.143 1.304 0.214 0.661 1.036 0.661 0.857 0 1.821-1.089v0.964zM18.929 25.857v-3.518q0-1.304-0.161-1.768-0.304-1-1.268-1-0.893 0-1.661 0.964v-3.875h-1.589v11.839h1.589v-0.857q0.804 0.982 1.661 0.982 0.964 0 1.268-0.982 0.161-0.482 0.161-1.786zM24.964 25.679v-0.232h-1.625q0 0.911-0.036 1.089-0.125 0.643-0.714 0.643-0.821 0-0.821-1.232v-1.554h3.196v-1.839q0-1.411-0.482-2.071-0.696-0.911-1.893-0.911-1.214 0-1.911 0.911-0.5 0.661-0.5 2.071v3.089q0 1.411 0.518 2.071 0.696 0.911 1.929 0.911 1.286 0 1.929-0.946 0.321-0.482 0.375-0.964 0.036-0.161 0.036-1.036zM14.107 9.375v-3.75q0-1.232-0.768-1.232t-0.768 1.232v3.75q0 1.25 0.768 1.25t0.768-1.25zM26.946 22.786q0 4.179-0.464 6.25-0.25 1.054-1.036 1.768t-1.821 0.821q-3.286 0.375-9.911 0.375t-9.911-0.375q-1.036-0.107-1.83-0.821t-1.027-1.768q-0.464-2-0.464-6.25 0-4.179 0.464-6.25 0.25-1.054 1.036-1.768t1.839-0.839q3.268-0.357 9.893-0.357t9.911 0.357q1.036 0.125 1.83 0.839t1.027 1.768q0.464 2 0.464 6.25zM9.125 0h1.821l-2.161 7.125v4.839h-1.786v-4.839q-0.25-1.321-1.089-3.786-0.661-1.839-1.161-3.339h1.893l1.268 4.696zM15.732 5.946v3.125q0 1.446-0.5 2.107-0.661 0.911-1.893 0.911-1.196 0-1.875-0.911-0.5-0.679-0.5-2.107v-3.125q0-1.429 0.5-2.089 0.679-0.911 1.875-0.911 1.232 0 1.893 0.911 0.5 0.661 0.5 2.089zM21.714 3.054v8.911h-1.625v-0.982q-0.946 1.107-1.839 1.107-0.821 0-1.054-0.661-0.143-0.429-0.143-1.339v-7.036h1.625v6.554q0 0.589 0.018 0.625 0.054 0.393 0.375 0.393 0.482 0 1.018-0.768v-6.804h1.625z>/path>/symbol>symbol idicon-dropbox viewBox0 0 32 32>path classpath1 dM7.179 12.625l8.821 5.446-6.107 5.089-8.75-5.696zM24.786 22.536v1.929l-8.75 5.232v0.018l-0.018-0.018-0.018 0.018v-0.018l-8.732-5.232v-1.929l2.625 1.714 6.107-5.071v-0.036l0.018 0.018 0.018-0.018v0.036l6.125 5.071zM9.893 2.107l6.107 5.089-8.821 5.429-6.036-4.821zM24.821 12.625l6.036 4.839-8.732 5.696-6.125-5.089zM22.125 2.107l8.732 5.696-6.036 4.821-8.821-5.429z>/path>/symbol>symbol idicon-instagram viewBox0 0 27 32>path classpath1 dM18.286 16q0-1.893-1.339-3.232t-3.232-1.339-3.232 1.339-1.339 3.232 1.339 3.232 3.232 1.339 3.232-1.339 1.339-3.232zM20.75 16q0 2.929-2.054 4.982t-4.982 2.054-4.982-2.054-2.054-4.982 2.054-4.982 4.982-2.054 4.982 2.054 2.054 4.982zM22.679 8.679q0 0.679-0.482 1.161t-1.161 0.482-1.161-0.482-0.482-1.161 0.482-1.161 1.161-0.482 1.161 0.482 0.482 1.161zM13.714 4.75q-0.125 0-1.366-0.009t-1.884 0-1.723 0.054-1.839 0.179-1.277 0.33q-0.893 0.357-1.571 1.036t-1.036 1.571q-0.196 0.518-0.33 1.277t-0.179 1.839-0.054 1.723 0 1.884 0.009 1.366-0.009 1.366 0 1.884 0.054 1.723 0.179 1.839 0.33 1.277q0.357 0.893 1.036 1.571t1.571 1.036q0.518 0.196 1.277 0.33t1.839 0.179 1.723 0.054 1.884 0 1.366-0.009 1.366 0.009 1.884 0 1.723-0.054 1.839-0.179 1.277-0.33q0.893-0.357 1.571-1.036t1.036-1.571q0.196-0.518 0.33-1.277t0.179-1.839 0.054-1.723 0-1.884-0.009-1.366 0.009-1.366 0-1.884-0.054-1.723-0.179-1.839-0.33-1.277q-0.357-0.893-1.036-1.571t-1.571-1.036q-0.518-0.196-1.277-0.33t-1.839-0.179-1.723-0.054-1.884 0-1.366 0.009zM27.429 16q0 4.089-0.089 5.661-0.179 3.714-2.214 5.75t-5.75 2.214q-1.571 0.089-5.661 0.089t-5.661-0.089q-3.714-0.179-5.75-2.214t-2.214-5.75q-0.089-1.571-0.089-5.661t0.089-5.661q0.179-3.714 2.214-5.75t5.75-2.214q1.571-0.089 5.661-0.089t5.661 0.089q3.714 0.179 5.75 2.214t2.214 5.75q0.089 1.571 0.089 5.661z>/path>/symbol>symbol idicon-flickr viewBox0 0 27 32>path classpath1 dM22.286 2.286q2.125 0 3.634 1.509t1.509 3.634v17.143q0 2.125-1.509 3.634t-3.634 1.509h-17.143q-2.125 0-3.634-1.509t-1.509-3.634v-17.143q0-2.125 1.509-3.634t3.634-1.509h17.143zM12.464 16q0-1.571-1.107-2.679t-2.679-1.107-2.679 1.107-1.107 2.679 1.107 2.679 2.679 1.107 2.679-1.107 1.107-2.679zM22.536 16q0-1.571-1.107-2.679t-2.679-1.107-2.679 1.107-1.107 2.679 1.107 2.679 2.679 1.107 2.679-1.107 1.107-2.679z>/path>/symbol>symbol idicon-tumblr viewBox0 0 19 32>path classpath1 dM16.857 23.732l1.429 4.232q-0.411 0.625-1.982 1.179t-3.161 0.571q-1.857 0.036-3.402-0.464t-2.545-1.321-1.696-1.893-0.991-2.143-0.295-2.107v-9.714h-3v-3.839q1.286-0.464 2.304-1.241t1.625-1.607 1.036-1.821 0.607-1.768 0.268-1.58q0.018-0.089 0.080-0.152t0.134-0.063h4.357v7.571h5.946v4.5h-5.964v9.25q0 0.536 0.116 1t0.402 0.938 0.884 0.741 1.455 0.25q1.393-0.036 2.393-0.518z>/path>/symbol>symbol idicon-dockerhub viewBox0 0 24 28>path classpath1 dM1.597 10.257h2.911v2.83H1.597v-2.83zm3.573 0h2.91v2.83H5.17v-2.83zm0-3.627h2.91v2.829H5.17V6.63zm3.57 3.627h2.912v2.83H8.74v-2.83zm0-3.627h2.912v2.829H8.74V6.63zm3.573 3.627h2.911v2.83h-2.911v-2.83zm0-3.627h2.911v2.829h-2.911V6.63zm3.572 3.627h2.911v2.83h-2.911v-2.83zM12.313 3h2.911v2.83h-2.911V3zm-6.65 14.173c-.449 0-.812.354-.812.788 0 .435.364.788.812.788.447 0 .811-.353.811-.788 0-.434-.363-.788-.811-.788>/path>path classpath2 dM28.172 11.721c-.978-.549-2.278-.624-3.388-.306-.136-1.146-.91-2.149-1.83-2.869l-.366-.286-.307.345c-.618.692-.8 1.845-.718 2.73.063.651.273 1.312.685 1.834-.313.183-.668.328-.985.434-.646.212-1.347.33-2.028.33H.083l-.042.429c-.137 1.432.065 2.866.674 4.173l.262.519.03.048c1.8 2.973 4.963 4.225 8.41 4.225 6.672 0 12.174-2.896 14.702-9.015 1.689.085 3.417-.4 4.243-1.968l.211-.4-.401-.223zM5.664 19.458c-.85 0-1.542-.671-1.542-1.497 0-.825.691-1.498 1.541-1.498.849 0 1.54.672 1.54 1.497s-.69 1.498-1.539 1.498z>/path>/symbol>symbol idicon-dribbble viewBox0 0 27 32>path classpath1 dM18.286 26.786q-0.75-4.304-2.5-8.893h-0.036l-0.036 0.018q-0.286 0.107-0.768 0.295t-1.804 0.875-2.446 1.464-2.339 2.045-1.839 2.643l-0.268-0.196q3.286 2.679 7.464 2.679 2.357 0 4.571-0.929zM14.982 15.946q-0.375-0.875-0.946-1.982-5.554 1.661-12.018 1.661-0.018 0.125-0.018 0.375 0 2.214 0.786 4.223t2.214 3.598q0.893-1.589 2.205-2.973t2.545-2.223 2.33-1.446 1.777-0.857l0.661-0.232q0.071-0.018 0.232-0.063t0.232-0.080zM13.071 12.161q-2.143-3.804-4.357-6.75-2.464 1.161-4.179 3.321t-2.286 4.857q5.393 0 10.821-1.429zM25.286 17.857q-3.75-1.071-7.304-0.518 1.554 4.268 2.286 8.375 1.982-1.339 3.304-3.384t1.714-4.473zM10.911 4.625q-0.018 0-0.036 0.018 0.018-0.018 0.036-0.018zM21.446 7.214q-3.304-2.929-7.732-2.929-1.357 0-2.768 0.339 2.339 3.036 4.393 6.821 1.232-0.464 2.321-1.080t1.723-1.098 1.17-1.018 0.67-0.723zM25.429 15.875q-0.054-4.143-2.661-7.321l-0.018 0.018q-0.161 0.214-0.339 0.438t-0.777 0.795-1.268 1.080-1.786 1.161-2.348 1.152q0.446 0.946 0.786 1.696 0.036 0.107 0.116 0.313t0.134 0.295q0.643-0.089 1.33-0.125t1.313-0.036 1.232 0.027 1.143 0.071 1.009 0.098 0.857 0.116 0.652 0.107 0.446 0.080zM27.429 16q0 3.732-1.839 6.884t-4.991 4.991-6.884 1.839-6.884-1.839-4.991-4.991-1.839-6.884 1.839-6.884 4.991-4.991 6.884-1.839 6.884 1.839 4.991 4.991 1.839 6.884z>/path>/symbol>symbol idicon-skype viewBox0 0 27 32>path classpath1 dM20.946 18.982q0-0.893-0.348-1.634t-0.866-1.223-1.304-0.875-1.473-0.607-1.563-0.411l-1.857-0.429q-0.536-0.125-0.786-0.188t-0.625-0.205-0.536-0.286-0.295-0.375-0.134-0.536q0-1.375 2.571-1.375 0.768 0 1.375 0.214t0.964 0.509 0.679 0.598 0.714 0.518 0.857 0.214q0.839 0 1.348-0.571t0.509-1.375q0-0.982-1-1.777t-2.536-1.205-3.25-0.411q-1.214 0-2.357 0.277t-2.134 0.839-1.589 1.554-0.598 2.295q0 1.089 0.339 1.902t1 1.348 1.429 0.866 1.839 0.58l2.607 0.643q1.607 0.393 2 0.643 0.571 0.357 0.571 1.071 0 0.696-0.714 1.152t-1.875 0.455q-0.911 0-1.634-0.286t-1.161-0.688-0.813-0.804-0.821-0.688-0.964-0.286q-0.893 0-1.348 0.536t-0.455 1.339q0 1.643 2.179 2.813t5.196 1.17q1.304 0 2.5-0.33t2.188-0.955 1.58-1.67 0.589-2.348zM27.429 22.857q0 2.839-2.009 4.848t-4.848 2.009q-2.321 0-4.179-1.429-1.375 0.286-2.679 0.286-2.554 0-4.884-0.991t-4.018-2.679-2.679-4.018-0.991-4.884q0-1.304 0.286-2.679-1.429-1.857-1.429-4.179 0-2.839 2.009-4.848t4.848-2.009q2.321 0 4.179 1.429 1.375-0.286 2.679-0.286 2.554 0 4.884 0.991t4.018 2.679 2.679 4.018 0.991 4.884q0 1.304-0.286 2.679 1.429 1.857 1.429 4.179z>/path>/symbol>symbol idicon-foursquare viewBox0 0 23 32>path classpath1 dM17.857 7.75l0.661-3.464q0.089-0.411-0.161-0.714t-0.625-0.304h-12.714q-0.411 0-0.688 0.304t-0.277 0.661v19.661q0 0.125 0.107 0.018l5.196-6.286q0.411-0.464 0.679-0.598t0.857-0.134h4.268q0.393 0 0.661-0.259t0.321-0.527q0.429-2.321 0.661-3.411 0.071-0.375-0.205-0.714t-0.652-0.339h-5.25q-0.518 0-0.857-0.339t-0.339-0.857v-0.75q0-0.518 0.339-0.848t0.857-0.33h6.179q0.321 0 0.625-0.241t0.357-0.527zM21.911 3.786q-0.268 1.304-0.955 4.759t-1.241 6.25-0.625 3.098q-0.107 0.393-0.161 0.58t-0.25 0.58-0.438 0.589-0.688 0.375-1.036 0.179h-4.839q-0.232 0-0.393 0.179-0.143 0.161-7.607 8.821-0.393 0.446-1.045 0.509t-0.866-0.098q-0.982-0.393-0.982-1.75v-25.179q0-0.982 0.679-1.83t2.143-0.848h15.857q1.696 0 2.268 0.946t0.179 2.839zM21.911 3.786l-2.821 14.107q0.071-0.304 0.625-3.098t1.241-6.25 0.955-4.759z>/path>/symbol>symbol idicon-wordpress viewBox0 0 32 32>path classpath1 dM2.268 16q0-2.911 1.196-5.589l6.554 17.946q-3.5-1.696-5.625-5.018t-2.125-7.339zM25.268 15.304q0 0.339-0.045 0.688t-0.179 0.884-0.205 0.786-0.313 1.054-0.313 1.036l-1.357 4.571-4.964-14.75q0.821-0.054 1.571-0.143 0.339-0.036 0.464-0.33t-0.045-0.554-0.509-0.241l-3.661 0.179q-1.339-0.018-3.607-0.179-0.214-0.018-0.366 0.089t-0.205 0.268-0.027 0.33 0.161 0.295 0.348 0.143l1.429 0.143 2.143 5.857-3 9-5-14.857q0.821-0.054 1.571-0.143 0.339-0.036 0.464-0.33t-0.045-0.554-0.509-0.241l-3.661 0.179q-0.125 0-0.411-0.009t-0.464-0.009q1.875-2.857 4.902-4.527t6.563-1.67q2.625 0 5.009 0.946t4.259 2.661h-0.179q-0.982 0-1.643 0.723t-0.661 1.705q0 0.214 0.036 0.429t0.071 0.384 0.143 0.411 0.161 0.375 0.214 0.402 0.223 0.375 0.259 0.429 0.25 0.411q1.125 1.911 1.125 3.786zM16.232 17.196l4.232 11.554q0.018 0.107 0.089 0.196-2.25 0.786-4.554 0.786-2 0-3.875-0.571zM28.036 9.411q1.696 3.107 1.696 6.589 0 3.732-1.857 6.884t-4.982 4.973l4.196-12.107q1.054-3.018 1.054-4.929 0-0.75-0.107-1.411zM16 0q3.25 0 6.214 1.268t5.107 3.411 3.411 5.107 1.268 6.214-1.268 6.214-3.411 5.107-5.107 3.411-6.214 1.268-6.214-1.268-5.107-3.411-3.411-5.107-1.268-6.214 1.268-6.214 3.411-5.107 5.107-3.411 6.214-1.268zM16 31.268q3.089 0 5.92-1.214t4.875-3.259 3.259-4.875 1.214-5.92-1.214-5.92-3.259-4.875-4.875-3.259-5.92-1.214-5.92 1.214-4.875 3.259-3.259 4.875-1.214 5.92 1.214 5.92 3.259 4.875 4.875 3.259 5.92 1.214z>/path>/symbol>symbol idicon-stumbleupon viewBox0 0 34 32>path classpath1 dM18.964 12.714v-2.107q0-0.75-0.536-1.286t-1.286-0.536-1.286 0.536-0.536 1.286v10.929q0 3.125-2.25 5.339t-5.411 2.214q-3.179 0-5.42-2.241t-2.241-5.42v-4.75h5.857v4.679q0 0.768 0.536 1.295t1.286 0.527 1.286-0.527 0.536-1.295v-11.071q0-3.054 2.259-5.214t5.384-2.161q3.143 0 5.393 2.179t2.25 5.25v2.429l-3.482 1.036zM28.429 16.679h5.857v4.75q0 3.179-2.241 5.42t-5.42 2.241q-3.161 0-5.411-2.223t-2.25-5.366v-4.786l2.339 1.089 3.482-1.036v4.821q0 0.75 0.536 1.277t1.286 0.527 1.286-0.527 0.536-1.277v-4.911z>/path>/symbol>symbol idicon-digg viewBox0 0 37 32>path classpath1 dM5.857 5.036h3.643v17.554h-9.5v-12.446h5.857v-5.107zM5.857 19.661v-6.589h-2.196v6.589h2.196zM10.964 10.143v12.446h3.661v-12.446h-3.661zM10.964 5.036v3.643h3.661v-3.643h-3.661zM16.089 10.143h9.518v16.821h-9.518v-2.911h5.857v-1.464h-5.857v-12.446zM21.946 19.661v-6.589h-2.196v6.589h2.196zM27.071 10.143h9.5v16.821h-9.5v-2.911h5.839v-1.464h-5.839v-12.446zM32.911 19.661v-6.589h-2.196v6.589h2.196z>/path>/symbol>symbol idicon-spotify viewBox0 0 27 32>path classpath1 dM20.125 21.607q0-0.571-0.536-0.911-3.446-2.054-7.982-2.054-2.375 0-5.125 0.607-0.75 0.161-0.75 0.929 0 0.357 0.241 0.616t0.634 0.259q0.089 0 0.661-0.143 2.357-0.482 4.339-0.482 4.036 0 7.089 1.839 0.339 0.196 0.589 0.196 0.339 0 0.589-0.241t0.25-0.616zM21.839 17.768q0-0.714-0.625-1.089-4.232-2.518-9.786-2.518-2.732 0-5.411 0.75-0.857 0.232-0.857 1.143 0 0.446 0.313 0.759t0.759 0.313q0.125 0 0.661-0.143 2.179-0.589 4.482-0.589 4.982 0 8.714 2.214 0.429 0.232 0.679 0.232 0.446 0 0.759-0.313t0.313-0.759zM23.768 13.339q0-0.839-0.714-1.25-2.25-1.304-5.232-1.973t-6.125-0.67q-3.643 0-6.5 0.839-0.411 0.125-0.688 0.455t-0.277 0.866q0 0.554 0.366 0.929t0.92 0.375q0.196 0 0.714-0.143 2.375-0.661 5.482-0.661 2.839 0 5.527 0.607t4.527 1.696q0.375 0.214 0.714 0.214 0.518 0 0.902-0.366t0.384-0.92zM27.429 16q0 3.732-1.839 6.884t-4.991 4.991-6.884 1.839-6.884-1.839-4.991-4.991-1.839-6.884 1.839-6.884 4.991-4.991 6.884-1.839 6.884 1.839 4.991 4.991 1.839 6.884z>/path>/symbol>symbol idicon-soundcloud viewBox0 0 41 32>path classpath1 dM14 24.5l0.286-4.304-0.286-9.339q-0.018-0.179-0.134-0.304t-0.295-0.125q-0.161 0-0.286 0.125t-0.125 0.304l-0.25 9.339 0.25 4.304q0.018 0.179 0.134 0.295t0.277 0.116q0.393 0 0.429-0.411zM19.286 23.982l0.196-3.768-0.214-10.464q0-0.286-0.232-0.429-0.143-0.089-0.286-0.089t-0.286 0.089q-0.232 0.143-0.232 0.429l-0.018 0.107-0.179 10.339q0 0.018 0.196 4.214v0.018q0 0.179 0.107 0.304 0.161 0.196 0.411 0.196 0.196 0 0.357-0.161 0.161-0.125 0.161-0.357zM0.625 17.911l0.357 2.286-0.357 2.25q-0.036 0.161-0.161 0.161t-0.161-0.161l-0.304-2.25 0.304-2.286q0.036-0.161 0.161-0.161t0.161 0.161zM2.161 16.5l0.464 3.696-0.464 3.625q-0.036 0.161-0.179 0.161-0.161 0-0.161-0.179l-0.411-3.607 0.411-3.696q0-0.161 0.161-0.161 0.143 0 0.179 0.161zM3.804 15.821l0.446 4.375-0.446 4.232q0 0.196-0.196 0.196-0.179 0-0.214-0.196l-0.375-4.232 0.375-4.375q0.036-0.214 0.214-0.214 0.196 0 0.196 0.214zM5.482 15.696l0.411 4.5-0.411 4.357q-0.036 0.232-0.25 0.232-0.232 0-0.232-0.232l-0.375-4.357 0.375-4.5q0-0.232 0.232-0.232 0.214 0 0.25 0.232zM7.161 16.018l0.375 4.179-0.375 4.393q-0.036 0.286-0.286 0.286-0.107 0-0.188-0.080t-0.080-0.205l-0.357-4.393 0.357-4.179q0-0.107 0.080-0.188t0.188-0.080q0.25 0 0.286 0.268zM8.839 13.411l0.375 6.786-0.375 4.393q0 0.125-0.089 0.223t-0.214 0.098q-0.286 0-0.321-0.321l-0.321-4.393 0.321-6.786q0.036-0.321 0.321-0.321 0.125 0 0.214 0.098t0.089 0.223zM10.518 11.875l0.339 8.357-0.339 4.357q0 0.143-0.098 0.241t-0.241 0.098q-0.321 0-0.357-0.339l-0.286-4.357 0.286-8.357q0.036-0.339 0.357-0.339 0.143 0 0.241 0.098t0.098 0.241zM12.268 11.161l0.321 9.036-0.321 4.321q-0.036 0.375-0.393 0.375-0.339 0-0.375-0.375l-0.286-4.321 0.286-9.036q0-0.161 0.116-0.277t0.259-0.116q0.161 0 0.268 0.116t0.125 0.277zM19.268 24.411v0 0zM15.732 11.089l0.268 9.107-0.268 4.268q0 0.179-0.134 0.313t-0.313 0.134-0.304-0.125-0.143-0.321l-0.25-4.268 0.25-9.107q0-0.196 0.134-0.321t0.313-0.125 0.313 0.125 0.134 0.321zM17.5 11.429l0.25 8.786-0.25 4.214q0 0.196-0.143 0.339t-0.339 0.143-0.339-0.143-0.161-0.339l-0.214-4.214 0.214-8.786q0.018-0.214 0.161-0.357t0.339-0.143 0.33 0.143 0.152 0.357zM21.286 20.214l-0.25 4.125q0 0.232-0.161 0.393t-0.393 0.161-0.393-0.161-0.179-0.393l-0.107-2.036-0.107-2.089 0.214-11.357v-0.054q0.036-0.268 0.214-0.429 0.161-0.125 0.357-0.125 0.143 0 0.268 0.089 0.25 0.143 0.286 0.464zM41.143 19.875q0 2.089-1.482 3.563t-3.571 1.473h-14.036q-0.232-0.036-0.393-0.196t-0.161-0.393v-16.054q0-0.411 0.5-0.589 1.518-0.607 3.232-0.607 3.482 0 6.036 2.348t2.857 5.777q0.946-0.393 1.964-0.393 2.089 0 3.571 1.482t1.482 3.589z>/path>/symbol>symbol idicon-codepen viewBox0 0 32 32>path classpath1 dM3.857 20.875l10.768 7.179v-6.411l-5.964-3.982zM2.75 18.304l3.446-2.304-3.446-2.304v4.607zM17.375 28.054l10.768-7.179-4.804-3.214-5.964 3.982v6.411zM16 19.25l4.857-3.25-4.857-3.25-4.857 3.25zM8.661 14.339l5.964-3.982v-6.411l-10.768 7.179zM25.804 16l3.446 2.304v-4.607zM23.339 14.339l4.804-3.214-10.768-7.179v6.411zM32 11.125v9.75q0 0.732-0.607 1.143l-14.625 9.75q-0.375 0.232-0.768 0.232t-0.768-0.232l-14.625-9.75q-0.607-0.411-0.607-1.143v-9.75q0-0.732 0.607-1.143l14.625-9.75q0.375-0.232 0.768-0.232t0.768 0.232l14.625 9.75q0.607 0.411 0.607 1.143z>/path>/symbol>symbol idicon-twitch viewBox0 0 32 32>path classpath1 dM16 7.75v7.75h-2.589v-7.75h2.589zM23.107 7.75v7.75h-2.589v-7.75h2.589zM23.107 21.321l4.518-4.536v-14.196h-21.321v18.732h5.821v3.875l3.875-3.875h7.107zM30.214 0v18.089l-7.75 7.75h-5.821l-3.875 3.875h-3.875v-3.875h-7.107v-20.679l1.946-5.161h26.482z>/path>/symbol>symbol idicon-meanpath viewBox0 0 27 32>path classpath1 dM23.411 15.036v2.036q0 0.429-0.241 0.679t-0.67 0.25h-3.607q-0.429 0-0.679-0.25t-0.25-0.679v-2.036q0-0.429 0.25-0.679t0.679-0.25h3.607q0.429 0 0.67 0.25t0.241 0.679zM14.661 19.143v-4.464q0-0.946-0.58-1.527t-1.527-0.58h-2.375q-1.214 0-1.714 0.929-0.5-0.929-1.714-0.929h-2.321q-0.946 0-1.527 0.58t-0.58 1.527v4.464q0 0.393 0.375 0.393h0.982q0.393 0 0.393-0.393v-4.107q0-0.429 0.241-0.679t0.688-0.25h1.679q0.429 0 0.679 0.25t0.25 0.679v4.107q0 0.393 0.375 0.393h0.964q0.393 0 0.393-0.393v-4.107q0-0.429 0.25-0.679t0.679-0.25h1.732q0.429 0 0.67 0.25t0.241 0.679v4.107q0 0.393 0.393 0.393h0.982q0.375 0 0.375-0.393zM25.179 17.429v-2.75q0-0.946-0.589-1.527t-1.536-0.58h-4.714q-0.946 0-1.536 0.58t-0.589 1.527v7.321q0 0.375 0.393 0.375h0.982q0.375 0 0.375-0.375v-3.214q0.554 0.75 1.679 0.75h3.411q0.946 0 1.536-0.58t0.589-1.527zM27.429 6.429v19.143q0 1.714-1.214 2.929t-2.929 1.214h-19.143q-1.714 0-2.929-1.214t-1.214-2.929v-19.143q0-1.714 1.214-2.929t2.929-1.214h19.143q1.714 0 2.929 1.214t1.214 2.929z>/path>/symbol>symbol idicon-pinterest-p viewBox0 0 23 32>path classpath1 dM0 10.661q0-1.929 0.67-3.634t1.848-2.973 2.714-2.196 3.304-1.393 3.607-0.464q2.821 0 5.25 1.188t3.946 3.455 1.518 5.125q0 1.714-0.339 3.357t-1.071 3.161-1.786 2.67-2.589 1.839-3.375 0.688q-1.214 0-2.411-0.571t-1.714-1.571q-0.179 0.696-0.5 2.009t-0.42 1.696-0.366 1.268-0.464 1.268-0.571 1.116-0.821 1.384-1.107 1.545l-0.25 0.089-0.161-0.179q-0.268-2.804-0.268-3.357 0-1.643 0.384-3.688t1.188-5.134 0.929-3.625q-0.571-1.161-0.571-3.018 0-1.482 0.929-2.786t2.357-1.304q1.089 0 1.696 0.723t0.607 1.83q0 1.179-0.786 3.411t-0.786 3.339q0 1.125 0.804 1.866t1.946 0.741q0.982 0 1.821-0.446t1.402-1.214 1-1.696 0.679-1.973 0.357-1.982 0.116-1.777q0-3.089-1.955-4.813t-5.098-1.723q-3.571 0-5.964 2.313t-2.393 5.866q0 0.786 0.223 1.518t0.482 1.161 0.482 0.813 0.223 0.545q0 0.5-0.268 1.304t-0.661 0.804q-0.036 0-0.304-0.054-0.911-0.268-1.616-1t-1.089-1.688-0.58-1.929-0.196-1.902z>/path>/symbol>symbol idicon-periscope viewBox0 0 24 28>path classpath1 dM12.285,1C6.696,1,2.277,5.643,2.277,11.243c0,5.851,7.77,14.578,10.007,14.578c1.959,0,9.729-8.728,9.729-14.578 C22.015,5.643,17.596,1,12.285,1z M12.317,16.551c-3.473,0-6.152-2.611-6.152-5.664c0-1.292,0.39-2.472,1.065-3.438 c0.206,1.084,1.18,1.906,2.352,1.906c1.322,0,2.393-1.043,2.393-2.333c0-0.832-0.447-1.561-1.119-1.975 c0.467-0.105,0.955-0.161,1.46-0.161c3.133,0,5.81,2.611,5.81,5.998C18.126,13.94,15.449,16.551,12.317,16.551z>/path>/symbol>symbol idicon-get-pocket viewBox0 0 31 32>path classpath1 dM27.946 2.286q1.161 0 1.964 0.813t0.804 1.973v9.268q0 3.143-1.214 6t-3.259 4.911-4.893 3.259-5.973 1.205q-3.143 0-5.991-1.205t-4.902-3.259-3.268-4.911-1.214-6v-9.268q0-1.143 0.821-1.964t1.964-0.821h25.161zM15.375 21.286q0.839 0 1.464-0.589l7.214-6.929q0.661-0.625 0.661-1.518 0-0.875-0.616-1.491t-1.491-0.616q-0.839 0-1.464 0.589l-5.768 5.536-5.768-5.536q-0.625-0.589-1.446-0.589-0.875 0-1.491 0.616t-0.616 1.491q0 0.911 0.643 1.518l7.232 6.929q0.589 0.589 1.446 0.589z>/path>/symbol>symbol idicon-vimeo viewBox0 0 32 32>path classpath1 dM30.518 9.25q-0.179 4.214-5.929 11.625-5.946 7.696-10.036 7.696-2.536 0-4.286-4.696-0.786-2.857-2.357-8.607-1.286-4.679-2.804-4.679-0.321 0-2.268 1.357l-1.375-1.75q0.429-0.375 1.929-1.723t2.321-2.063q2.786-2.464 4.304-2.607 1.696-0.161 2.732 0.991t1.446 3.634q0.786 5.125 1.179 6.661 0.982 4.446 2.143 4.446 0.911 0 2.75-2.875 1.804-2.875 1.946-4.393 0.232-2.482-1.946-2.482-1.018 0-2.161 0.464 2.143-7.018 8.196-6.821 4.482 0.143 4.214 5.821z>/path>/symbol>symbol idicon-reddit-alien viewBox0 0 32 32>path classpath1 dM32 15.107q0 1.036-0.527 1.884t-1.42 1.295q0.214 0.821 0.214 1.714 0 2.768-1.902 5.125t-5.188 3.723-7.143 1.366-7.134-1.366-5.179-3.723-1.902-5.125q0-0.839 0.196-1.679-0.911-0.446-1.464-1.313t-0.554-1.902q0-1.464 1.036-2.509t2.518-1.045q1.518 0 2.589 1.125 3.893-2.714 9.196-2.893l2.071-9.304q0.054-0.232 0.268-0.375t0.464-0.089l6.589 1.446q0.321-0.661 0.964-1.063t1.411-0.402q1.107 0 1.893 0.777t0.786 1.884-0.786 1.893-1.893 0.786-1.884-0.777-0.777-1.884l-5.964-1.321-1.857 8.429q5.357 0.161 9.268 2.857 1.036-1.089 2.554-1.089 1.482 0 2.518 1.045t1.036 2.509zM7.464 18.661q0 1.107 0.777 1.893t1.884 0.786 1.893-0.786 0.786-1.893-0.786-1.884-1.893-0.777q-1.089 0-1.875 0.786t-0.786 1.875zM21.929 25q0.196-0.196 0.196-0.464t-0.196-0.464q-0.179-0.179-0.446-0.179t-0.464 0.179q-0.732 0.75-2.161 1.107t-2.857 0.357-2.857-0.357-2.161-1.107q-0.196-0.179-0.464-0.179t-0.446 0.179q-0.196 0.179-0.196 0.455t0.196 0.473q0.768 0.768 2.116 1.214t2.188 0.527 1.625 0.080 1.625-0.080 2.188-0.527 2.116-1.214zM21.875 21.339q1.107 0 1.884-0.786t0.777-1.893q0-1.089-0.786-1.875t-1.875-0.786q-1.107 0-1.893 0.777t-0.786 1.884 0.786 1.893 1.893 0.786z>/path>/symbol>symbol idicon-whatsapp viewBox0 0 32 32>path dM15.968 2.003a14.03 13.978 0 0 0-14.03 13.978 14.03 13.978 0 0 0 2.132 7.391L1.938 29.96l6.745-2.052a14.03 13.978 0 0 0 7.285 2.052 14.03 13.978 0 0 0 14.03-13.978 14.03 13.978 0 0 0-14.03-13.978z stroke-width.2000562/>path dM10.454 8.236a2.57 3.401 51.533 0 0-1.475 3.184v.015c.01 2.04 4.045 10.076 10.017 12.688l.017-.013a2.57 3.401 51.533 0 0 3.454-.706 2.57 3.401 51.533 0 0 1.064-4.129 2.57 3.401 51.533 0 0-4.262.103 2.57 3.401 51.533 0 0-.505.473c-1.346-.639-2.952-1.463-4.168-2.98-.771-.962-1.257-2.732-1.549-4.206a2.57 3.401 51.533 0 0 .605-.403 2.57 3.401 51.533 0 0 1.064-4.129 2.57 3.401 51.533 0 0-4.262.103z stroke-width.372/>/symbol>symbol idicon-telegram viewBox0 0 32 32>path dM30.8,2.2L0.6,13.9c-0.8,0.3-0.7,1.3,0,1.6l7.4,2.8l2.9,9.2c0.2,0.6,0.9,0.8,1.4,0.4l4.1-3.4 c0.4-0.4,1-0.4,1.5,0l7.4,5.4c0.5,0.4,1.2,0.1,1.4-0.5L32,3.2C32.1,2.5,31.4,1.9,30.8,2.2z M25,8.3l-11.9,11 c-0.4,0.4-0.7,0.9-0.8,1.5l-0.4,3c-0.1,0.4-0.6,0.4-0.7,0.1l-1.6-5.5c-0.2-0.6,0.1-1.3,0.6-1.6l14.4-8.9C25,7.7,25.3,8.1,25,8.3z/>/symbol>symbol idicon-hashtag viewBox0 0 32 32>path classpath1 dM17.696 18.286l1.143-4.571h-4.536l-1.143 4.571h4.536zM31.411 9.286l-1 4q-0.125 0.429-0.554 0.429h-5.839l-1.143 4.571h5.554q0.268 0 0.446 0.214 0.179 0.25 0.107 0.5l-1 4q-0.089 0.429-0.554 0.429h-5.839l-1.446 5.857q-0.125 0.429-0.554 0.429h-4q-0.286 0-0.464-0.214-0.161-0.214-0.107-0.5l1.393-5.571h-4.536l-1.446 5.857q-0.125 0.429-0.554 0.429h-4.018q-0.268 0-0.446-0.214-0.161-0.214-0.107-0.5l1.393-5.571h-5.554q-0.268 0-0.446-0.214-0.161-0.214-0.107-0.5l1-4q0.125-0.429 0.554-0.429h5.839l1.143-4.571h-5.554q-0.268 0-0.446-0.214-0.179-0.25-0.107-0.5l1-4q0.089-0.429 0.554-0.429h5.839l1.446-5.857q0.125-0.429 0.571-0.429h4q0.268 0 0.446 0.214 0.161 0.214 0.107 0.5l-1.393 5.571h4.536l1.446-5.857q0.125-0.429 0.571-0.429h4q0.268 0 0.446 0.214 0.161 0.214 0.107 0.5l-1.393 5.571h5.554q0.268 0 0.446 0.214 0.161 0.214 0.107 0.5z>/path>/symbol>symbol idicon-chain viewBox0 0 30 32>path classpath1 dM26 21.714q0-0.714-0.5-1.214l-3.714-3.714q-0.5-0.5-1.214-0.5-0.75 0-1.286 0.571 0.054 0.054 0.339 0.33t0.384 0.384 0.268 0.339 0.232 0.455 0.063 0.491q0 0.714-0.5 1.214t-1.214 0.5q-0.268 0-0.491-0.063t-0.455-0.232-0.339-0.268-0.384-0.384-0.33-0.339q-0.589 0.554-0.589 1.304 0 0.714 0.5 1.214l3.679 3.696q0.482 0.482 1.214 0.482 0.714 0 1.214-0.464l2.625-2.607q0.5-0.5 0.5-1.196zM13.446 9.125q0-0.714-0.5-1.214l-3.679-3.696q-0.5-0.5-1.214-0.5-0.696 0-1.214 0.482l-2.625 2.607q-0.5 0.5-0.5 1.196 0 0.714 0.5 1.214l3.714 3.714q0.482 0.482 1.214 0.482 0.75 0 1.286-0.554-0.054-0.054-0.339-0.33t-0.384-0.384-0.268-0.339-0.232-0.455-0.063-0.491q0-0.714 0.5-1.214t1.214-0.5q0.268 0 0.491 0.063t0.455 0.232 0.339 0.268 0.384 0.384 0.33 0.339q0.589-0.554 0.589-1.304zM29.429 21.714q0 2.143-1.518 3.625l-2.625 2.607q-1.482 1.482-3.625 1.482-2.161 0-3.643-1.518l-3.679-3.696q-1.482-1.482-1.482-3.625 0-2.196 1.571-3.732l-1.571-1.571q-1.536 1.571-3.714 1.571-2.143 0-3.643-1.5l-3.714-3.714q-1.5-1.5-1.5-3.643t1.518-3.625l2.625-2.607q1.482-1.482 3.625-1.482 2.161 0 3.643 1.518l3.679 3.696q1.482 1.482 1.482 3.625 0 2.196-1.571 3.732l1.571 1.571q1.536-1.571 3.714-1.571 2.143 0 3.643 1.5l3.714 3.714q1.5 1.5 1.5 3.643z>/path>/symbol>symbol idicon-thumb-tack viewBox0 0 21 32>path classpath1 dM8.571 15.429v-8q0-0.25-0.161-0.411t-0.411-0.161-0.411 0.161-0.161 0.411v8q0 0.25 0.161 0.411t0.411 0.161 0.411-0.161 0.161-0.411zM20.571 21.714q0 0.464-0.339 0.804t-0.804 0.339h-7.661l-0.911 8.625q-0.036 0.214-0.188 0.366t-0.366 0.152h-0.018q-0.482 0-0.571-0.482l-1.357-8.661h-7.214q-0.464 0-0.804-0.339t-0.339-0.804q0-2.196 1.402-3.955t3.17-1.759v-9.143q-0.929 0-1.607-0.679t-0.679-1.607 0.679-1.607 1.607-0.679h11.429q0.929 0 1.607 0.679t0.679 1.607-0.679 1.607-1.607 0.679v9.143q1.768 0 3.17 1.759t1.402 3.955z>/path>/symbol>symbol idicon-arrow-left viewBox0 0 43 32>path classpath1 dM42.311 14.044c-0.178-0.178-0.533-0.356-0.711-0.356h-33.778l10.311-10.489c0.178-0.178 0.356-0.533 0.356-0.711 0-0.356-0.178-0.533-0.356-0.711l-1.6-1.422c-0.356-0.178-0.533-0.356-0.889-0.356s-0.533 0.178-0.711 0.356l-14.578 14.933c-0.178 0.178-0.356 0.533-0.356 0.711s0.178 0.533 0.356 0.711l14.756 14.933c0 0.178 0.356 0.356 0.533 0.356s0.533-0.178 0.711-0.356l1.6-1.6c0.178-0.178 0.356-0.533 0.356-0.711s-0.178-0.533-0.356-0.711l-10.311-10.489h33.778c0.178 0 0.533-0.178 0.711-0.356 0.356-0.178 0.533-0.356 0.533-0.711v-2.133c0-0.356-0.178-0.711-0.356-0.889z>/path>/symbol>symbol idicon-arrow-right viewBox0 0 43 32>path classpath1 dM0.356 17.956c0.178 0.178 0.533 0.356 0.711 0.356h33.778l-10.311 10.489c-0.178 0.178-0.356 0.533-0.356 0.711 0 0.356 0.178 0.533 0.356 0.711l1.6 1.6c0.178 0.178 0.533 0.356 0.711 0.356s0.533-0.178 0.711-0.356l14.756-14.933c0.178-0.356 0.356-0.711 0.356-0.889s-0.178-0.533-0.356-0.711l-14.756-14.933c0-0.178-0.356-0.356-0.533-0.356s-0.533 0.178-0.711 0.356l-1.6 1.6c-0.178 0.178-0.356 0.533-0.356 0.711s0.178 0.533 0.356 0.711l10.311 10.489h-33.778c-0.178 0-0.533 0.178-0.711 0.356-0.356 0.178-0.533 0.356-0.533 0.711v2.311c0 0.178 0.178 0.533 0.356 0.711z>/path>/symbol>symbol idicon-play viewBox0 0 22 28>path dM21.625 14.484l-20.75 11.531c-0.484 0.266-0.875 0.031-0.875-0.516v-23c0-0.547 0.391-0.781 0.875-0.516l20.75 11.531c0.484 0.266 0.484 0.703 0 0.969z>/path>/symbol>symbol idicon-pause viewBox0 0 24 28>path dM24 3v22c0 0.547-0.453 1-1 1h-8c-0.547 0-1-0.453-1-1v-22c0-0.547 0.453-1 1-1h8c0.547 0 1 0.453 1 1zM10 3v22c0 0.547-0.453 1-1 1h-8c-0.547 0-1-0.453-1-1v-22c0-0.547 0.453-1 1-1h8c0.547 0 1 0.453 1 1z>/path>/symbol>/defs>/svg>/body>/html>
Port 443
HTTP/1.1 200 OKContent-Type: text/html; charsetUTF-8Transfer-Encoding: chunkedConnection: keep-aliveKeep-Alive: timeout15Date: Wed, 30 Oct 2024 08:26:06 GMTServer: ApacheLink: https://davidlopez.es/wp-json/>; relhttps://api.w.org/ !DOCTYPE html>html langes classno-js no-svg>head>meta charsetUTF-8>meta nameviewport contentwidthdevice-width, initial-scale1>link relprofile hrefhttps://gmpg.org/xfn/11>script>(function(html){html.className html.className.replace(/\bno-js\b/,js)})(document.documentElement);/script>title>David López/title>link reldns-prefetch href//www.google.com />link reldns-prefetch href//platform.twitter.com />link reldns-prefetch href//fonts.googleapis.com />link reldns-prefetch href//s.w.org />link hrefhttps://fonts.gstatic.com crossorigin relpreconnect />link relalternate typeapplication/rss+xml titleDavid López » Feed hrefhttps://davidlopez.es/feed/ />link relalternate typeapplication/rss+xml titleDavid López » Feed de los comentarios hrefhttps://davidlopez.es/comments/feed/ /> script> window._wpemojiSettings {baseUrl:https:\/\/s.w.org\/images\/core\/emoji\/13.0.1\/72x72\/,ext:.png,svgUrl:https:\/\/s.w.org\/images\/core\/emoji\/13.0.1\/svg\/,svgExt:.svg,source:{concatemoji:https:\/\/davidlopez.es\/wp-includes\/js\/wp-emoji-release.min.js?ver5.6.14}}; !function(e,a,t){var n,r,o,ia.createElement(canvas),pi.getContext&&i.getContext(2d);function s(e,t){var aString.fromCharCode;p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,e),0,0);ei.toDataURL();return p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,t),0,0),ei.toDataURL()}function c(e){var ta.createElement(script);t.srce,t.defert.typetext/javascript,a.getElementsByTagName(head)0.appendChild(t)}for(oArray(flag,emoji),t.supports{everything:!0,everythingExceptFlag:!0},r0;ro.length;r++)t.supportsorfunction(e){if(!p||!p.fillText)return!1;switch(p.textBaselinetop,p.font600 32px Arial,e){caseflag:return s(127987,65039,8205,9895,65039,127987,65039,8203,9895,65039)?!1:!s(55356,56826,55356,56819,55356,56826,8203,55356,56819)&&!s(55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447,55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447);caseemoji:return!s(55357,56424,8205,55356,57212,55357,56424,8203,55356,57212)}return!1}(or),t.supports.everythingt.supports.everything&&t.supportsor,flag!or&&(t.supports.everythingExceptFlagt.supports.everythingExceptFlag&&t.supportsor);t.supports.everythingExceptFlagt.supports.everythingExceptFlag&&!t.supports.flag,t.DOMReady!1,t.readyCallbackfunction(){t.DOMReady!0},t.supports.everything||(nfunction(){t.readyCallback()},a.addEventListener?(a.addEventListener(DOMContentLoaded,n,!1),e.addEventListener(load,n,!1)):(e.attachEvent(onload,n),a.attachEvent(onreadystatechange,function(){completea.readyState&&t.readyCallback()})),(nt.source||{}).concatemoji?c(n.concatemoji):n.wpemoji&&n.twemoji&&(c(n.twemoji),c(n.wpemoji)))}(window,document,window._wpemojiSettings); /script> style>img.wp-smiley,img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 .07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important;}/style> link relstylesheet idwp-block-library-css hrefhttps://davidlopez.es/wp-includes/css/dist/block-library/style.min.css?ver5.6.14 mediaall />link relstylesheet idwp-block-library-theme-css hrefhttps://davidlopez.es/wp-includes/css/dist/block-library/theme.min.css?ver5.6.14 mediaall />link relstylesheet idcontact-form-7-css hrefhttps://davidlopez.es/wp-content/plugins/contact-form-7/includes/css/styles.css?ver5.3.2 mediaall />link relstylesheet idwp-syntax-css-css hrefhttps://davidlopez.es/wp-content/plugins/wp-syntax/css/wp-syntax.css?ver1.1 mediaall />link relstylesheet idtwentyseventeen-fonts-css hrefhttps://fonts.googleapis.com/css?familyLibre+Franklin%3A300%2C300i%2C400%2C400i%2C600%2C600i%2C800%2C800i&subsetlatin%2Clatin-ext&displayfallback mediaall />link relstylesheet idtwentyseventeen-style-css hrefhttps://davidlopez.es/wp-content/themes/twentyseventeen/style.css?ver20201208 mediaall />link relstylesheet idtwentyseventeen-block-style-css hrefhttps://davidlopez.es/wp-content/themes/twentyseventeen/assets/css/blocks.css?ver20190105 mediaall />!--if lt IE 9>link relstylesheet idtwentyseventeen-ie8-css hrefhttps://davidlopez.es/wp-content/themes/twentyseventeen/assets/css/ie8.css?ver20161202 mediaall />!endif-->script srchttps://davidlopez.es/wp-includes/js/jquery/jquery.min.js?ver3.5.1 idjquery-core-js>/script>script srchttps://davidlopez.es/wp-includes/js/jquery/jquery-migrate.min.js?ver3.3.2 idjquery-migrate-js>/script>!--if lt IE 9>script srchttps://davidlopez.es/wp-content/themes/twentyseventeen/assets/js/html5.js?ver20161020 idhtml5-js>/script>!endif-->link relhttps://api.w.org/ hrefhttps://davidlopez.es/wp-json/ />link relEditURI typeapplication/rsd+xml titleRSD hrefhttps://davidlopez.es/xmlrpc.php?rsd />link relwlwmanifest typeapplication/wlwmanifest+xml hrefhttps://davidlopez.es/wp-includes/wlwmanifest.xml /> meta namegenerator contentWordPress 5.6.14 />link relme hrefhttps://twitter.com/DLopez_87>meta nametwitter:widgets:link-color content#000000>meta nametwitter:widgets:border-color content#000000>meta nametwitter:partner contenttfwp>meta nametwitter:card contentsummary>meta nametwitter:title contentDavid López>meta nametwitter:site content@DLopez_87>meta nametwitter:description contentPh. D. Computer Vision> style idwp-custom-css> .grecaptcha-badge{opacity:0} /style> /head>body classblog wp-embed-responsive hfeed has-header-image has-sidebar colors-light>div idpage classsite> a classskip-link screen-reader-text href#content>Saltar al contenido/a> header idmasthead classsite-header rolebanner> div classcustom-header> div classcustom-header-media> div idwp-custom-header classwp-custom-header>img srchttps://davidlopez.es/wp-content/uploads/2019/05/cropped-5236306032_cc0d8e6a70_b.jpg width2000 height1199 altDavid López srcsethttps://davidlopez.es/wp-content/uploads/2019/05/cropped-5236306032_cc0d8e6a70_b.jpg 2000w, https://davidlopez.es/wp-content/uploads/2019/05/cropped-5236306032_cc0d8e6a70_b-300x180.jpg 300w, https://davidlopez.es/wp-content/uploads/2019/05/cropped-5236306032_cc0d8e6a70_b-768x460.jpg 768w, https://davidlopez.es/wp-content/uploads/2019/05/cropped-5236306032_cc0d8e6a70_b-1024x614.jpg 1024w sizes100vw />/div> /div> div classsite-branding> div classwrap> div classsite-branding-text> p classsite-title>a hrefhttps://davidlopez.es/ relhome>David López/a>/p> p classsite-description>Ph. D. Computer Vision/p> /div>!-- .site-branding-text --> /div>!-- .wrap -->/div>!-- .site-branding -->/div>!-- .custom-header --> div classnavigation-top> div classwrap> nav idsite-navigation classmain-navigation rolenavigation aria-labelMenú superior> button classmenu-toggle aria-controlstop-menu aria-expandedfalse> svg classicon icon-bars aria-hiddentrue roleimg> use href#icon-bars xlink:href#icon-bars>/use> /svg>svg classicon icon-close aria-hiddentrue roleimg> use href#icon-close xlink:href#icon-close>/use> /svg>Menú /button> div classmenu-principal-container>ul idtop-menu classmenu>li idmenu-item-43 classmenu-item menu-item-type-post_type menu-item-object-page menu-item-43>a hrefhttps://davidlopez.es/sobre-mi/>Sobre mí/a>/li>li idmenu-item-37 classmenu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-37>a>Producción científicasvg classicon icon-angle-down aria-hiddentrue roleimg> use href#icon-angle-down xlink:href#icon-angle-down>/use> /svg>/a>ul classsub-menu> li idmenu-item-28 classmenu-item menu-item-type-post_type menu-item-object-page menu-item-28>a hrefhttps://davidlopez.es/conferencias-internacionales/>Conferencias internacionales/a>/li> li idmenu-item-27 classmenu-item menu-item-type-post_type menu-item-object-page menu-item-27>a hrefhttps://davidlopez.es/publicaciones/>Publicaciones en revistas JCR/a>/li> li idmenu-item-40 classmenu-item menu-item-type-post_type menu-item-object-page menu-item-40>a hrefhttps://davidlopez.es/datasets/>Bases de datos/a>/li> li idmenu-item-231 classmenu-item menu-item-type-post_type menu-item-object-page menu-item-231>a hrefhttps://davidlopez.es/tesis-doctoral/>Tesis doctoral/a>/li>/ul>/li>li idmenu-item-162 classmenu-item menu-item-type-post_type menu-item-object-page menu-item-162>a hrefhttps://davidlopez.es/proyectos/>Proyectos/a>/li>li idmenu-item-50 classmenu-item menu-item-type-post_type menu-item-object-page menu-item-50>a hrefhttps://davidlopez.es/contacto/>Contacto/a>/li>/ul>/div> /nav>!-- #site-navigation --> /div>!-- .wrap --> /div>!-- .navigation-top --> /header>!-- #masthead --> div classsite-content-contain> div idcontent classsite-content>div classwrap> header classpage-header> h1 classpage-title>/h1> /header> div idprimary classcontent-area> main idmain classsite-main rolemain> article idpost-200 classpost-200 post type-post status-publish format-standard has-post-thumbnail hentry category-internet tag-corba tag-orb> header classentry-header> div classentry-meta>span classscreen-reader-text>Publicado el/span> a hrefhttps://davidlopez.es/instalacion-de-omniorb-sobre-ubuntu-14-04/ relbookmark>time classentry-date published datetime2016-04-22T19:17:02+00:00>22 abril, 2016/time>time classupdated datetime2016-04-23T12:02:39+00:00>23 abril, 2016/time>/a>/div>!-- .entry-meta -->h2 classentry-title>a hrefhttps://davidlopez.es/instalacion-de-omniorb-sobre-ubuntu-14-04/ relbookmark>Instalación de OmniORB sobre Ubuntu 14.04/a>/h2> /header>!-- .entry-header --> div classpost-thumbnail> a hrefhttps://davidlopez.es/instalacion-de-omniorb-sobre-ubuntu-14-04/> img width122 height92 srchttps://davidlopez.es/wp-content/uploads/2016/04/omniORBlogo.gif classattachment-twentyseventeen-featured-image size-twentyseventeen-featured-image wp-post-image alt loadinglazy sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px /> /a> /div>!-- .post-thumbnail --> div classentry-content> p styletext-align: justify; alignjustify>a hrefhttp://omniorb.sourceforge.net/>OmniORB/a> es un Object Request Broker (ORB) que implementa la especificación 2.6 de la Common Object Request Broker Architecture (arquitectura común de intermediarios en peticiones a objetos), más conocida como CORBA./p>p styletext-align: justify; alignjustify>Ha sido diseñado para ser portable. Corre en muchos tipos de sistemas UNIX, Windows, varios sistemas operativos embebidos, y sistemas relativamente desconocidos como OpenVMS o Fujitsu-Siemens BS2000. Ha sido diseñado para ser fácil de portar a nuevas plataformas. El mapeo de IDL a C++ es el mismo para todas las plataformas./p>p styletext-align: justify; alignjustify>OmniORB usa excepciones y clases anidadas de C++. Mantiene en lo posible la especificación estándar de CORBA y no usa mapeos alternativos para C++. Se basa en librerías nativas de hilos que proporcionan capacidad multihilo. Además, también está disponible para Python./p>p styletext-align: justify; alignjustify>Para llevar a cabo la instalación de OmniORB (Free CORBA ORB) sobre Ubuntu 14.10, es necesario realizar los siguientes pasos:/p>ul>li>Descargar a hrefhttp://sourceforge.net/projects/omniorb/files/omniORB/omniORB-4.1.5/omniORB-4.1.5.tar.bz2/download>OmniORB 4.1.5/a>/li>li>Descomprimir. Para ello, escribimos en terminal:div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #c20cb9; font-weight: bold;>tar/span> xzf omniORB-span stylecolor: #000000;>4/span>.X.X.tar.gz span stylecolor: #7a0874; font-weight: bold;>cd/span> omniORB-span stylecolor: #000000;>4/span>.X.X/pre>/td>/tr>/table>p classtheCode styledisplay:none;>tar xzf omniORB-4.X.X.tar.gz cd omniORB-4.X.X/p>/div>/li>li>Configure:div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>.span stylecolor: #000000; font-weight: bold;>//span>configure span stylecolor: #660033;>--prefix/span>span stylecolor: #000000; font-weight: bold;>//span>opt span stylecolor: #660033;>--enable-threads/span> span stylecolor: #660033;>--enable-shared/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>./configure --prefix/opt --enable-threads --enable-shared/p>/div>/li>li>Compilardiv classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #c20cb9; font-weight: bold;>make/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>make/p>/div>/li>li>Instalardiv classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #c20cb9; font-weight: bold;>make/span> span stylecolor: #c20cb9; font-weight: bold;>install/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>make install/p>/div>/li>/ul>p>Se pueden configurar algunas opciones en el momento de la instalación mediante el uso debr />algunos flags:/p>ul>ul>li>–disable-static: Compilación rápida. Algunas librerías estáticas son producidas./li>li>–enable-threads: Usa pthreads/li>li>–enable-shared: default – shared libraries generadas/li>/ul>/ul>p>Más información en a hrefhttp://omniorb.sourceforge.net/omni41/omniORB/index.html>The omniORB version 4.1 User’s Guide/a>./p>div idsgmbShare1-1 classsgmbShare jssocials-theme-minima sgmbWidget1-1>/div>div classdropdownWrapper dropdownWrapper1 dropdownWrapper-for-widget iddropdownWrapper-for-widget> div classdropdownLabel iddropdownLabel-share-list>span classsgmbButtonListLabel1>Share List/span>/div> div classdropdownPanel dropdownPanel1-1> /div> /div>script> SGMB_URL https://davidlopez.es/wp-content/plugins/social-media-builder/; jQuery(.dropdownWrapper).hide(); SGMB_GOOGLE_ACOUNT ; /script>script typetext/javascript> jQuery(document).ready(function($){var widget new SGMBWidget();widget.show({id:1,title:Share!,options:{currentUrl:1,url:,fontSize:24,theme:cloud,buttonsPosition:,socialTheme:minima,icon:cloud,buttonsPanelEffect:swing,buttonsEffect:No Effect,iconsEffect:No Effect,buttons:{\facebook\:{\label\:\Comp\\u00e1rtelo\,\icon\:\cloud-facebook\},\twitter\:{\label\:\Tweet\,\icon\:\cloud-twitter\,\via\:\\,\hashtags\:\\},\linkedin\:{\label\:\Publ\\u00edcalo\,\icon\:\cloud-linkedin\},\googleplus\:{\label\:\+1\,\icon\:\cloud-googleplus\}},roundButton:,showLabels:,showCounts:,showButtonsAsList:,setButtonsPosition:,sgmbDropdownColor:,sgmbDropdownLabelFontSize:14,sgmbDropdownLabelColor:,showButtonsOnEveryPost:,sgmbPostionOnEveryPost:Left,textOnEveryPost:,showButtonsOnMobileDirect:on},buttonOptions:{facebook:{label:Comp\u00e1rtelo,icon:cloud-facebook},twitter:{label:Tweet,icon:cloud-twitter,via:,hashtags:},linkedin:{label:Publ\u00edcalo,icon:cloud-linkedin},googleplus:{label:+1,icon:cloud-googleplus}},button:facebook,twitter,linkedin,googleplus}, 1, , https://davidlopez.es/wp-content/uploads/2016/04/omniORBlogo.gif, , https://davidlopez.es/instalacion-de-omniorb-sobre-ubuntu-14-04/); });/script> /div>!-- .entry-content --> /article>!-- #post-200 -->article idpost-186 classpost-186 post type-post status-publish format-standard has-post-thumbnail hentry category-internet tag-ftp> header classentry-header> div classentry-meta>span classscreen-reader-text>Publicado el/span> a hrefhttps://davidlopez.es/instalar-y-configurar-proftpd-en-ubuntu-14-04/ relbookmark>time classentry-date published datetime2016-04-22T17:57:09+00:00>22 abril, 2016/time>time classupdated datetime2016-04-23T12:03:36+00:00>23 abril, 2016/time>/a>/div>!-- .entry-meta -->h2 classentry-title>a hrefhttps://davidlopez.es/instalar-y-configurar-proftpd-en-ubuntu-14-04/ relbookmark>Instalar y configurar ProFTPD en Ubuntu 14.04/a>/h2> /header>!-- .entry-header --> div classpost-thumbnail> a hrefhttps://davidlopez.es/instalar-y-configurar-proftpd-en-ubuntu-14-04/> img width403 height193 srchttps://davidlopez.es/wp-content/uploads/2016/04/proftpd_logo.png classattachment-twentyseventeen-featured-image size-twentyseventeen-featured-image wp-post-image alt loadinglazy srcsethttps://davidlopez.es/wp-content/uploads/2016/04/proftpd_logo.png 403w, https://davidlopez.es/wp-content/uploads/2016/04/proftpd_logo-300x144.png 300w sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px /> /a> /div>!-- .post-thumbnail --> div classentry-content> div classentry>p styletext-align: justify;>Recientemente he necesitado instalar y configurar un servicio de FTP (File Transfer Protocol) sobre Ubuntu 14.04 Natty Narwhal. Para este propósito, he elegido ProFTPd. ProFTPd es un servidor FTP bajo licencia GPL y multiplataforma. Puede configurarse de una manera rápida y fácil. Además, soporta IPv6.Estos son los pasos a seguir para su instalación y configuración:/p>p>code>sudo apt-get install proftpd/code>/p>p>A continuación se puede seleccionar «INETD» o «Independiente». Seleccionar «Independiente». Después, abrir el fichero /etc/proftpd/proftpd.conf y descomentar la línea DefaultRoot ~ , quedando como sigue:/p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classhtml stylefont-family:monospace;># Use this to jail all users in their homesDefaultRoot ~/pre>/td>/tr>/table>p classtheCode styledisplay:none;># Use this to jail all users in their homesDefaultRoot ~/p>/div>p>Reiniciar el servicio, con sudo /etc/init.d/proftpd restart. Ahora ya puedes acceder por FTP a tu directorio HOME./p>p>Opcionalmente, podemos crear un nuevo usuario:/p>p>code>sudo mkdir /home/usuarioftp/code>/p>p>Lo añadimos al sistema/p>p>code>sudo useradd -d /home/usuarioftp -s /bin/false usuarioftp/code>/p>p>y le asignamos una carpeta:/p>p>code>sudo chown -R usuarioftp /home/usuarioftp/code>/p>p>Antes de proceder a establecer los permisos, necesitamos especificar contraseña del usuario:/p>p>code>sudo passwd usuarioftp/code>/p>p>Ahora, añadimos al final del fichero proftpd.conf el siguiente bloque para limitar el acceso por FTP solo permitiendo el usuario que hemos creado:/p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classhtml stylefont-family:monospace;>AllowUser usuarioftpDenyAll RequireValidShell off/pre>/td>/tr>/table>p classtheCode styledisplay:none;>AllowUser usuarioftpDenyAllRequireValidShell off/p>/div>p>Y para terminar reiniciamos el servicio de ProFTPd para aplicar los cambios:/p>p>code>/etc/init.d/proftpd restart/code>/p>div idsgmbShare1-2 classsgmbShare jssocials-theme-minima sgmbWidget1-2>/div>div classdropdownWrapper dropdownWrapper1 dropdownWrapper-for-widget iddropdownWrapper-for-widget> div classdropdownLabel iddropdownLabel-share-list>span classsgmbButtonListLabel1>Share List/span>/div> div classdropdownPanel dropdownPanel1-2> /div> /div>script> SGMB_URL https://davidlopez.es/wp-content/plugins/social-media-builder/; jQuery(.dropdownWrapper).hide(); SGMB_GOOGLE_ACOUNT ; /script>script typetext/javascript> jQuery(document).ready(function($){var widget new SGMBWidget();widget.show({id:1,title:Share!,options:{currentUrl:1,url:,fontSize:24,theme:cloud,buttonsPosition:,socialTheme:minima,icon:cloud,buttonsPanelEffect:swing,buttonsEffect:No Effect,iconsEffect:No Effect,buttons:{\facebook\:{\label\:\Comp\\u00e1rtelo\,\icon\:\cloud-facebook\},\twitter\:{\label\:\Tweet\,\icon\:\cloud-twitter\,\via\:\\,\hashtags\:\\},\linkedin\:{\label\:\Publ\\u00edcalo\,\icon\:\cloud-linkedin\},\googleplus\:{\label\:\+1\,\icon\:\cloud-googleplus\}},roundButton:,showLabels:,showCounts:,showButtonsAsList:,setButtonsPosition:,sgmbDropdownColor:,sgmbDropdownLabelFontSize:14,sgmbDropdownLabelColor:,showButtonsOnEveryPost:,sgmbPostionOnEveryPost:Left,textOnEveryPost:,showButtonsOnMobileDirect:on},buttonOptions:{facebook:{label:Comp\u00e1rtelo,icon:cloud-facebook},twitter:{label:Tweet,icon:cloud-twitter,via:,hashtags:},linkedin:{label:Publ\u00edcalo,icon:cloud-linkedin},googleplus:{label:+1,icon:cloud-googleplus}},button:facebook,twitter,linkedin,googleplus}, 2, , https://davidlopez.es/wp-content/uploads/2016/04/proftpd_logo.png, , https://davidlopez.es/instalar-y-configurar-proftpd-en-ubuntu-14-04/); });/script>/div> /div>!-- .entry-content --> /article>!-- #post-186 -->article idpost-177 classpost-177 post type-post status-publish format-standard has-post-thumbnail hentry category-sin-categoria> header classentry-header> div classentry-meta>span classscreen-reader-text>Publicado el/span> a hrefhttps://davidlopez.es/suma-concurrente-de-vectores-con-nvidia-cuda/ relbookmark>time classentry-date published datetime2016-04-22T13:59:30+00:00>22 abril, 2016/time>time classupdated datetime2016-04-23T12:04:04+00:00>23 abril, 2016/time>/a>/div>!-- .entry-meta -->h2 classentry-title>a hrefhttps://davidlopez.es/suma-concurrente-de-vectores-con-nvidia-cuda/ relbookmark>Suma concurrente de vectores con NVidia CUDA/a>/h2> /header>!-- .entry-header --> div classpost-thumbnail> a hrefhttps://davidlopez.es/suma-concurrente-de-vectores-con-nvidia-cuda/> img width294 height171 srchttps://davidlopez.es/wp-content/uploads/2016/04/images.png classattachment-twentyseventeen-featured-image size-twentyseventeen-featured-image wp-post-image alt loadinglazy sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px /> /a> /div>!-- .post-thumbnail --> div classentry-content> p styletext-align: justify;>CUDA es una arquitectura hardware y software para la computación en la GPU. Consiste en utilizar el procesador gráfico o GPU como coprocesador junto con la CPU./p>p styletext-align: justify;>La GPU es un procesador especializado cuyas capacidades de cómputo se resumen en lo siguiente:/p>ul styletext-align: justify;>li>Múltiples núcleos dirigidos por un gran ancho de banda de memoria./li>li>Gran paralelismo./li>li>Optimización para cálculos en coma flotante./li>li>Bajo coste./li>li>Ingente cantidad de transistores.ul>li>Procesamiento de datos./li>li>Almacenamiento en caché./li>li>Control del flujo./li>/ul>/li>/ul>p styletext-align: justify;>Estos son generalmente los pasos de cualquier aplicación CUDA:/p>ol styletext-align: justify;>li>Copiar los datos a procesar desde la memoria de la CPU a la memoria de la GPU./li>li>Invocar el Kernel en la GPU./li>li>El Kernel ejecuta iteraciones del bucle en paralelo en cada núcleo./li>li>Copiar el resultado desde la memoria de la GPU a la memoria de la CPU./li>/ol>p styletext-align: justify;>El siguiente programa utiliza esta arquitectura para realizar de forma concurrente la suma de dos vectores a y b, y almacenar el resultado en un tercer vector c. Cabe destacar que este es el ejemplo b>más sencillo/b> que se puede encontrar del uso de CUDA./p>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071/pre>/td>td classcode>pre classcpp stylefont-family:monospace;>span stylecolor: #339900;>#include /span>span stylecolor: #339900;>#include /span>span stylecolor: #339900;>#include /span> span stylecolor: #0000ff;>using/span> span stylecolor: #0000ff;>namespace/span> stdspan stylecolor: #008080;>;/span> span stylecolor: #339900;>#define TAM 8 // Tamanho del vector/span> span stylecolor: #666666;>// Declaración del kernel/span>__global__ span stylecolor: #0000ff;>void/span> kernelSumaspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #000040;>*/span> a, span stylecolor: #0000ff;>int/span>span stylecolor: #000040;>*/span> b, span stylecolor: #0000ff;>int/span>span stylecolor: #000040;>*/span> cspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> mainspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span> argc, span stylecolor: #0000ff;>char/span> span stylecolor: #000040;>*/span>argvspan stylecolor: #008000;>[/span>span stylecolor: #008000;>]/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>int/span> span stylecolor: #000040;>*/span>a_h, span stylecolor: #000040;>*/span>b_h, span stylecolor: #000040;>*/span>c_hspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> span stylecolor: #000040;>*/span>a_d, span stylecolor: #000040;>*/span>b_d, span stylecolor: #000040;>*/span>c_dspan stylecolor: #008080;>;/span> span stylecolor: #666666;>// Reservamos memoria para los vectores host/span> a_h span stylecolor: #000080;>/span> span stylecolor: #0000dd;>new/span> span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>[/span>TAMspan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> b_h span stylecolor: #000080;>/span> span stylecolor: #0000dd;>new/span> span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>[/span>TAMspan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> c_h span stylecolor: #000080;>/span> span stylecolor: #0000dd;>new/span> span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>[/span>TAMspan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// Reservamos memoria en la GPU/span> cudaMallocspan stylecolor: #008000;>(/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span> span stylecolor: #000040;>**/span>span stylecolor: #008000;>)/span>span stylecolor: #000040;>&/span>a_d, TAMspan stylecolor: #000040;>*/span>span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> cudaMallocspan stylecolor: #008000;>(/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span> span stylecolor: #000040;>**/span>span stylecolor: #008000;>)/span>span stylecolor: #000040;>&/span>b_d, TAMspan stylecolor: #000040;>*/span>span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> cudaMallocspan stylecolor: #008000;>(/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span> span stylecolor: #000040;>**/span>span stylecolor: #008000;>)/span>span stylecolor: #000040;>&/span>c_d, TAMspan stylecolor: #000040;>*/span>span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// Se configura un tamanio de bloque de 4 hilos/span> span stylecolor: #0000ff;>int/span> tamanio_bloque span stylecolor: #000080;>/span> span stylecolor: #0000dd;>4/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> num_bloques span stylecolor: #000080;>/span> TAMspan stylecolor: #000040;>//span>tamanio_bloque span stylecolor: #000040;>+/span> span stylecolor: #008000;>(/span>TAMspan stylecolor: #000040;>%/span>tamanio_bloque span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span> span stylecolor: #008080;>?/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>:/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// Inicialización de los vectores en memoria host/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span> ispan stylecolor: #000080;>/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span>ispan stylecolor: #000080;></span>TAMspan stylecolor: #008080;>;/span>ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> a_hspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span> span stylecolor: #000080;>/span> ispan stylecolor: #008080;>;/span> b_hspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span> span stylecolor: #000080;>/span> ispan stylecolor: #000040;>*/span>span stylecolor: #0000dd;>2/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #666666;>// Copiamos los datos desde la memoria host a la memoria device/span> cudaMemcpyspan stylecolor: #008000;>(/span>a_d, a_h, TAMspan stylecolor: #000040;>*/span>span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>)/span>, cudaMemcpyHostToDevicespan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> cudaMemcpyspan stylecolor: #008000;>(/span>b_d, b_h, TAMspan stylecolor: #000040;>*/span>span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>)/span>, cudaMemcpyHostToDevicespan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> kernelSumaspan stylecolor: #000080;><<</span>tamanio_bloque, num_bloquesspan stylecolor: #000080;>>>>/span>span stylecolor: #008000;>(/span>a_d, b_d, c_dspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// Copia los resultados del vector c desde la memoria de la GPU/span> span stylecolor: #666666;>// a la memoria del host/span> cudaMemcpyspan stylecolor: #008000;>(/span>c_h, c_d, TAMspan stylecolor: #000040;>*/span>span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>)/span>, cudaMemcpyDeviceToHostspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// Imprime los resultados/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span> i span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> i span stylecolor: #000080;></span> TAMspan stylecolor: #008080;>;/span> ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span> span stylecolor: #0000dd;>cout/span> span stylecolor: #000080;><</span> c_hspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span> span stylecolor: #000080;><</span> span stylecolor: #FF0000;>" "/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>cout/span> span stylecolor: #000080;><</span> endlspan stylecolor: #008080;>;/span> span stylecolor: #666666;>// Libera la memoria/span> span stylecolor: #666666;>// Tanto en el host.../span> span stylecolor: #0000dd;>free/span>span stylecolor: #008000;>(/span>a_hspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>free/span>span stylecolor: #008000;>(/span>b_hspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>free/span>span stylecolor: #008000;>(/span>c_hspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// ...como en la device./span> cudaFreespan stylecolor: #008000;>(/span>a_dspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> cudaFreespan stylecolor: #008000;>(/span>b_dspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> cudaFreespan stylecolor: #008000;>(/span>c_dspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #666666;>// Definición del kernel/span>__global__ span stylecolor: #0000ff;>void/span> kernelSumaspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span> span stylecolor: #000040;>*/span>a, span stylecolor: #0000ff;>int/span> span stylecolor: #000040;>*/span>b, span stylecolor: #0000ff;>int/span> span stylecolor: #000040;>*/span>cspan stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #666666;>// i Número de bloque * dimensión del bloque + hilo dentro del bloque/span> span stylecolor: #0000ff;>int/span> i span stylecolor: #000080;>/span> blockIdx.span stylecolor: #007788;>x/span> span stylecolor: #000040;>*/span> blockDim.span stylecolor: #007788;>x/span> span stylecolor: #000040;>+/span> threadIdx.span stylecolor: #007788;>x/span>span stylecolor: #008080;>;/span> cspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span> span stylecolor: #000080;>/span> aspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>span stylecolor: #000040;>+/span>bspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span>span stylecolor: #008000;>}/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>#include #include #include using namespace std;#define TAM 8 // Tamanho del vector// Declaración del kernel__global__ void kernelSuma(int* a, int* b, int* c);int main(int argc, char *argv) { int *a_h, *b_h, *c_h; int *a_d, *b_d, *c_d; // Reservamos memoria para los vectores host a_h new intTAM; b_h new intTAM; c_h new intTAM; // Reservamos memoria en la GPU cudaMalloc((void **)&a_d, TAM*sizeof(int)); cudaMalloc((void **)&b_d, TAM*sizeof(int)); cudaMalloc((void **)&c_d, TAM*sizeof(int)); // Se configura un tamanio de bloque de 4 hilos int tamanio_bloque 4; int num_bloques TAM/tamanio_bloque + (TAM%tamanio_bloque 0 ? 0:1); // Inicialización de los vectores en memoria host for(int i0;i<TAM;i++) { a_hi i; b_hi i*2; } // Copiamos los datos desde la memoria host a la memoria device cudaMemcpy(a_d, a_h, TAM*sizeof(int), cudaMemcpyHostToDevice); cudaMemcpy(b_d, b_h, TAM*sizeof(int), cudaMemcpyHostToDevice); kernelSuma<<<tamanio_bloque, num_bloques>>>(a_d, b_d, c_d); // Copia los resultados del vector c desde la memoria de la GPU // a la memoria del host cudaMemcpy(c_h, c_d, TAM*sizeof(int), cudaMemcpyDeviceToHost); // Imprime los resultados for(int i 0; i < TAM; i++) cout << c_hi << " "; cout << endl; // Libera la memoria // Tanto en el host... free(a_h); free(b_h); free(c_h); // ...como en la device. cudaFree(a_d); cudaFree(b_d); cudaFree(c_d);} // Definición del kernel__global__ void kernelSuma(int *a, int *b, int *c) { // i Número de bloque * dimensión del bloque + hilo dentro del bloque int i blockIdx.x * blockDim.x + threadIdx.x; ci ai+bi;}/p>/div>div idsgmbShare1-3 classsgmbShare jssocials-theme-minima sgmbWidget1-3>/div>div classdropdownWrapper dropdownWrapper1 dropdownWrapper-for-widget iddropdownWrapper-for-widget> div classdropdownLabel iddropdownLabel-share-list>span classsgmbButtonListLabel1>Share List/span>/div> div classdropdownPanel dropdownPanel1-3> /div> /div>script> SGMB_URL https://davidlopez.es/wp-content/plugins/social-media-builder/; jQuery(.dropdownWrapper).hide(); SGMB_GOOGLE_ACOUNT ; /script>script typetext/javascript> jQuery(document).ready(function($){var widget new SGMBWidget();widget.show({id:1,title:Share!,options:{currentUrl:1,url:,fontSize:24,theme:cloud,buttonsPosition:,socialTheme:minima,icon:cloud,buttonsPanelEffect:swing,buttonsEffect:No Effect,iconsEffect:No Effect,buttons:{\facebook\:{\label\:\Comp\\u00e1rtelo\,\icon\:\cloud-facebook\},\twitter\:{\label\:\Tweet\,\icon\:\cloud-twitter\,\via\:\\,\hashtags\:\\},\linkedin\:{\label\:\Publ\\u00edcalo\,\icon\:\cloud-linkedin\},\googleplus\:{\label\:\+1\,\icon\:\cloud-googleplus\}},roundButton:,showLabels:,showCounts:,showButtonsAsList:,setButtonsPosition:,sgmbDropdownColor:,sgmbDropdownLabelFontSize:14,sgmbDropdownLabelColor:,showButtonsOnEveryPost:,sgmbPostionOnEveryPost:Left,textOnEveryPost:,showButtonsOnMobileDirect:on},buttonOptions:{facebook:{label:Comp\u00e1rtelo,icon:cloud-facebook},twitter:{label:Tweet,icon:cloud-twitter,via:,hashtags:},linkedin:{label:Publ\u00edcalo,icon:cloud-linkedin},googleplus:{label:+1,icon:cloud-googleplus}},button:facebook,twitter,linkedin,googleplus}, 3, , https://davidlopez.es/wp-content/uploads/2016/04/images.png, , https://davidlopez.es/suma-concurrente-de-vectores-con-nvidia-cuda/); });/script> /div>!-- .entry-content --> /article>!-- #post-177 -->article idpost-169 classpost-169 post type-post status-publish format-standard has-post-thumbnail hentry category-internet category-programacion> header classentry-header> div classentry-meta>span classscreen-reader-text>Publicado el/span> a hrefhttps://davidlopez.es/chat-multihilo-con-sockets-en-python-y-en-c/ relbookmark>time classentry-date published datetime2016-04-20T14:07:34+00:00>20 abril, 2016/time>time classupdated datetime2016-04-24T23:31:54+00:00>24 abril, 2016/time>/a>/div>!-- .entry-meta -->h2 classentry-title>a hrefhttps://davidlopez.es/chat-multihilo-con-sockets-en-python-y-en-c/ relbookmark>Chat multihilo con Sockets en Python y en C/a>/h2> /header>!-- .entry-header --> div classpost-thumbnail> a hrefhttps://davidlopez.es/chat-multihilo-con-sockets-en-python-y-en-c/> img width981 height599 srchttps://davidlopez.es/wp-content/uploads/2016/04/chatgrafico.png classattachment-twentyseventeen-featured-image size-twentyseventeen-featured-image wp-post-image alt loadinglazy srcsethttps://davidlopez.es/wp-content/uploads/2016/04/chatgrafico.png 981w, https://davidlopez.es/wp-content/uploads/2016/04/chatgrafico-300x183.png 300w, https://davidlopez.es/wp-content/uploads/2016/04/chatgrafico-768x469.png 768w sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px /> /a> /div>!-- .post-thumbnail --> div classentry-content> p alignjustify>La b>computación concurrente/b> es la capacidad de simultanear en la ejecución de múltiples tareas interactivas. Un proceso es un programa en ejecución, que es gestionado por el Sistema Operativo y compite por los recursos del procesador. Los procesos tienen estado y memoria en ejecución reservada. El mecanismo por el cual un proceso crea otro proceso se denomina bifurcación (fork). Cuando un proceso se bifurca, se crea una copia exacta del proceso en ejecución, independiente del resto y no comparte el espacio de memoria con el proceso que los ha creado ni con otros procesos./p>p alignjustify>Un b>hilo/b>, en sistemas operativos, es una característica que permite a una aplicación realizar varias tareas a la vez (concurrentemente). Los distintos hilos de ejecución comparten una serie de recursos tales como el espacio de memoria, o los archivos abiertos. Esta técnica permite simplificar el diseño de una aplicación que debe llevar a cabo distintas funciones simultáneamente. Un hilo es un tarea que se ejecuta en paralelo con otra tarea./p>p alignjustify>La comunicación entre el cliente y el servidor se hace posible gracias a estructuras abstractas denominadas b>sockets/b>, mediante las cuales los programas pueden intercambiar flujo de datos e información. Este concepto está asociado al concepto de puerto./p>p alignjustify>Un puerto es una forma genérica de denominar a una interfaz a través de la cual los diferentes tipos de datos se pueden enviar y recibir. En el protocolo TCP/IP, son de tipo lógico, por ejemplo, los puertos que permiten la transmisión de datos entre diferentes computadores./p>p alignjustify>Existen dos tipos de sockets, orientados a conexión y no orientados a conexión. La diferencia fundamental es que en los sockets orientados a conexión (TCP) el protocolo garantiza que los datos serán entregados en su destino sin errores y en el mismo orden en que se transmitieron, mientras que en los sockets no orientados a conexión (o UDP) no se garantiza que el mensaje llegue a su destino. Parece claro que si el programa envía un mensaje y no hay nadie escuchando, ese mensaje se pierde. De todas formas, aunque haya alguien escuchando, el protocolo tampoco garantiza que el mensaje llegue. Lo único que garantiza es, que si llega, llega sin errores./p>p alignjustify>En una b>comunicación con sockets multihilo/b>, como es el caso de la implementación que nos ocupa, cada conexión es gestionada por un proceso o hilo de ejecución independiente. Así, con cada cliente que conecte con el servidor, se expande un nuevo hilo del lado del servidor, que gestionará las peticiones del cliente asociado a él. Servidores concurrentes pueden ser multiproceso o multihilo. Estos son utilizados para servicios largos con mucha sincronización Cliente-Servidor./p>p alignjustify>A continuación dejo el código de ambas implementaciones, primero en C++ y después en Python./p>h3>Comandos/h3>ul>li>b>ADD usuario/b>:Introduce un usuario en el chat./li>li>b>LIST/b>: Obtiene la lista de clientes conectados./li>li>b>END/b>: Desconecta y sale de la sesión./li>li>b>TEXT/b>: Envía un mensaje a todos los usuarios conectados./li>li>b>TEXT TO usuario/b>: Envía un mensaje privado a un usuario./li>/ul>h4>En C++/h4>h5>Servidor/h5>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180/pre>/td>td classcode>pre classcpp stylefont-family:monospace;>span stylecolor: #339900;>#include <stdio.h>/span>span stylecolor: #339900;>#include <string.h>/span>span stylecolor: #339900;>#include <sys/types.h>/span>span stylecolor: #339900;>#include <unistd.h>/span>span stylecolor: #339900;>#include <stdlib.h>/span>span stylecolor: #339900;>#include <sys/types.h>/span>span stylecolor: #339900;>#include <sys/socket.h>/span>span stylecolor: #339900;>#include <netinet/in.h>/span>span stylecolor: #339900;>#include <arpa/inet.h>/span>span stylecolor: #339900;>#include <pthread.h>/span> span stylecolor: #339900;>#define SERVER_PORT 6543/span>span stylecolor: #339900;>#define SERVER_ADDRESS "127.0.0.1"/span>span stylecolor: #339900;>#define MAXLINE 512/span>span stylecolor: #339900;>#define MAXCLIENTS 10/span> span stylecolor: #0000ff;>int/span> buscarClientespan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>char/span>span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span>span stylecolor: #0000ff;>void/span> subCadenaspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>char/span>span stylecolor: #000040;>*/span>, span stylecolor: #0000ff;>char/span>span stylecolor: #000040;>*/span>, span stylecolor: #0000ff;>int/span>, span stylecolor: #0000ff;>int/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>struct/span> vectorspan stylecolor: #008000;>{/span> span stylecolor: #0000ff;>int/span> socketspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>char/span> usuariospan stylecolor: #008000;>[/span>MAXLINEspan stylecolor: #000040;>-/span>span stylecolor: #0000dd;>4/span>span stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> sign_inspan stylecolor: #008080;>;/span>span stylecolor: #008000;>}/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>struct/span> vector vectorClientesspan stylecolor: #008000;>[/span>MAXCLIENTSspan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span>span stylecolor: #0000ff;>int/span> clientes span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> mainspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span> argc, span stylecolor: #0000ff;>char/span> span stylecolor: #000040;>*/span>argvspan stylecolor: #008000;>[/span>span stylecolor: #008000;>]/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> gestionaClientespan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> pspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> socketfd, new_sdspan stylecolor: #008080;>;/span> socklen_t client_lenspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>struct/span> sockaddr_in server_addr, client_addrspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> i, status, idspan stylecolor: #008080;>;/span> pthread_t hilosspan stylecolor: #008000;>[/span>MAXCLIENTSspan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>ispan stylecolor: #000080;>/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span>ispan stylecolor: #000080;></span>MAXCLIENTSspan stylecolor: #008080;>;/span>ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span> span stylecolor: #0000dd;>strcpy/span>span stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>usuario/span>, span stylecolor: #FF0000;>" "/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// Open TCP internet STREAM socket/span> span stylecolor: #0000ff;>if/span> span stylecolor: #008000;>(/span>span stylecolor: #008000;>(/span>socketfd span stylecolor: #000080;>/span> socketspan stylecolor: #008000;>(/span>AF_INET, SOCK_STREAM, span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span> span stylecolor: #000080;></span> span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span> span stylecolor: #0000dd;>perror/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"server: Cant open stream socket"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// Bind local address to allow the client to connect/span> bzerospan stylecolor: #008000;>(/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>char/span> span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&/span>server_addr, span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>server_addrspan stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> server_addr.span stylecolor: #007788;>sin_family/span> span stylecolor: #000080;>/span> AF_INETspan stylecolor: #008080;>;/span> server_addr.span stylecolor: #007788;>sin_addr/span>.span stylecolor: #007788;>s_addr/span> span stylecolor: #000080;>/span> htonlspan stylecolor: #008000;>(/span>INADDR_ANYspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> server_addr.span stylecolor: #007788;>sin_port/span> span stylecolor: #000080;>/span> htonsspan stylecolor: #008000;>(/span>SERVER_PORTspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>if/span> span stylecolor: #008000;>(/span>bind span stylecolor: #008000;>(/span>socketfd, span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>struct/span> sockaddr span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&/span>server_addr, span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>server_addrspan stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span> span stylecolor: #000080;></span> span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span> span stylecolor: #0000dd;>perror/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"server: cant bind local address"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> listenspan stylecolor: #008000;>(/span>socketfd, span stylecolor: #0000dd;>5/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>for/span> span stylecolor: #008000;>(/span>span stylecolor: #008080;>;;/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> client_len span stylecolor: #000080;>/span> span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>client_addrspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>span stylecolor: #008000;>(/span>new_sd span stylecolor: #000080;>/span> acceptspan stylecolor: #008000;>(/span>socketfd, span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>struct/span> sockaddr span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&/span>client_addr, span stylecolor: #000040;>&/span>client_lenspan stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span> span stylecolor: #000080;></span> span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"Error aceptando peticionesspan stylecolor: #000099; font-weight: bold;>\n/span>"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>exit/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>else/span> span stylecolor: #008000;>{/span> id span stylecolor: #000080;>/span> clientesspan stylecolor: #008080;>;/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>socket/span> span stylecolor: #000080;>/span> new_sdspan stylecolor: #008080;>;/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>fflush/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>stdout/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> clientesspan stylecolor: #000040;>++/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>if/span> span stylecolor: #008000;>(/span> span stylecolor: #008000;>(/span>status span stylecolor: #000080;>/span> pthread_createspan stylecolor: #008000;>(/span>span stylecolor: #000040;>&/span>hilosspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>,span stylecolor: #0000ff;>NULL/span>,gestionaCliente,span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span> span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span>span stylecolor: #000040;>&/span>idspan stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"Error al crear el hilospan stylecolor: #000099; font-weight: bold;>\n/span>"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>exit/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #008000;>}/span> span stylecolor: #008000;>}/span> closespan stylecolor: #008000;>(/span>socketfdspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>// Close original socket/span> span stylecolor: #0000ff;>return/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span>span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>void/span> subCadenaspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>char/span> span stylecolor: #000040;>*/span>subCad, span stylecolor: #0000ff;>char/span> span stylecolor: #000040;>*/span>cad, span stylecolor: #0000ff;>int/span> inicio, span stylecolor: #0000ff;>int/span> cuantosspan stylecolor: #008000;>)/span>span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>int/span> i,jspan stylecolor: #000080;>/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>ispan stylecolor: #000080;>/span>iniciospan stylecolor: #008080;>;/span>ispan stylecolor: #000080;></span>iniciospan stylecolor: #000040;>+/span>cuantos span stylecolor: #000040;>&&/span> cadspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>span stylecolor: #000040;>!/span>span stylecolor: #000080;>/span>span stylecolor: #FF0000;>span stylecolor: #006699; font-weight: bold;>\0/span>/span>span stylecolor: #008080;>;/span>ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> subCadspan stylecolor: #008000;>[/span>jspan stylecolor: #008000;>]/span>span stylecolor: #000080;>/span>cadspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> jspan stylecolor: #000040;>++/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> subCadspan stylecolor: #008000;>[/span>jspan stylecolor: #008000;>]/span>span stylecolor: #000080;>/span>span stylecolor: #FF0000;>span stylecolor: #006699; font-weight: bold;>\0/span>/span>span stylecolor: #008080;>;/span>span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>int/span> buscarClientespan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>char/span>span stylecolor: #000040;>*/span> usuariospan stylecolor: #008000;>)/span>span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>int/span> ispan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>ispan stylecolor: #000080;>/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span>ispan stylecolor: #000080;></span>clientesspan stylecolor: #008080;>;/span>ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>strcmp/span>span stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>usuario/span>,usuario span stylecolor: #008000;>)/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span> span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #0000ff;>return/span> vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>socket/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>return/span> span stylecolor: #000040;>-/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008080;>;/span>span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> gestionaClientespan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> pspan stylecolor: #008000;>)/span>span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>int/span> span stylecolor: #000040;>*/span>ide, idspan stylecolor: #008080;>;/span> ide span stylecolor: #000080;>/span> span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #000040;>*/span> span stylecolor: #008000;>)/span> pspan stylecolor: #008080;>;/span> id span stylecolor: #000080;>/span> span stylecolor: #000040;>*/span>idespan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>char/span> bufferspan stylecolor: #008000;>[/span>MAXLINEspan stylecolor: #008000;>]/span>, nombrespan stylecolor: #008000;>[/span>MAXLINEspan stylecolor: #000040;>-/span>span stylecolor: #0000dd;>4/span>span stylecolor: #008000;>]/span>, tempspan stylecolor: #008000;>[/span>MAXLINEspan stylecolor: #000040;>-/span>span stylecolor: #0000dd;>8/span>span stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> i, longitud, destinospan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>while/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> recvspan stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>socket/span>,buffer,MAXLINE,span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"span stylecolor: #000099; font-weight: bold;>\n/span>id%dspan stylecolor: #000099; font-weight: bold;>\n/span>"/span>, idspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>strstr/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>"ADD"/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> longitud span stylecolor: #000080;>/span> span stylecolor: #0000dd;>strlen/span>span stylecolor: #008000;>(/span>bufferspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>//Le quitamos el ADD/span> subCadenaspan stylecolor: #008000;>(/span>nombre, buffer, span stylecolor: #0000dd;>4/span>, longitudspan stylecolor: #000040;>-/span>span stylecolor: #0000dd;>4/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcpy/span>span stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>usuario/span>, nombrespan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>//Se informa a todos menos a él mismo y al que se haya ido/span> span stylecolor: #0000dd;>strcpy/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>"El usuario "/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>buffer, nombrespan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>" ha entrado en el chat."/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>i span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> i span stylecolor: #000080;></span> clientesspan stylecolor: #008080;>;/span> ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span> span stylecolor: #0000ff;>if/span> span stylecolor: #008000;>(/span>i span stylecolor: #000040;>!/span>span stylecolor: #000080;>/span> id span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> sendspan stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>socket/span>,buffer,MAXLINE,span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>strstr/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>"LIST"/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #666666;>//Se envia al cliente todos los usuarios menos los que hayan abandonado la sesión/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>i span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> i span stylecolor: #000080;></span> clientesspan stylecolor: #008080;>;/span> ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> sendspan stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>socket/span>, vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>usuario/span>, MAXLINE, span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>strstr/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>"END"/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #666666;>//Se informa a todos menos a él mismo y al que se haya ido/span> span stylecolor: #0000dd;>strcpy/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>"El usuario "/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>buffer, vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>usuario/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>" ha abandonado en el chat."/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> bzerospan stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>usuario/span>, MAXLINEspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>i span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> i span stylecolor: #000080;></span> clientesspan stylecolor: #008080;>;/span> ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span> span stylecolor: #0000ff;>if/span> span stylecolor: #008000;>(/span>i span stylecolor: #000040;>!/span>span stylecolor: #000080;>/span> id span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> sendspan stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>socket/span>,buffer,MAXLINE,span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>strstr/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>"TEXT"/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&&/span> span stylecolor: #000040;>!/span>span stylecolor: #0000dd;>strstr/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>"TEXT TO"/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> longitud span stylecolor: #000080;>/span> span stylecolor: #0000dd;>strlen/span>span stylecolor: #008000;>(/span>bufferspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> subCadenaspan stylecolor: #008000;>(/span>temp, buffer, span stylecolor: #0000dd;>5/span>, longitudspan stylecolor: #000040;>-/span>span stylecolor: #0000dd;>5/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>//Se envía a todos menos a él mismo y al que se haya ido/span> bzerospan stylecolor: #008000;>(/span>buffer, MAXLINEspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>buffer, vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>usuario/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>" dice: "/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>buffer, tempspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>for/span>span stylecolor: #008000;>(/span>i span stylecolor: #000080;>/span> span stylecolor: #0000dd;>0/span>span stylecolor: #008080;>;/span> i span stylecolor: #000080;></span> clientesspan stylecolor: #008080;>;/span> ispan stylecolor: #000040;>++/span>span stylecolor: #008000;>)/span> span stylecolor: #0000ff;>if/span> span stylecolor: #008000;>(/span>i span stylecolor: #000040;>!/span>span stylecolor: #000080;>/span> id span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> sendspan stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>ispan stylecolor: #008000;>]/span>.span stylecolor: #007788;>socket/span>,buffer,MAXLINE,span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>strstr/span>span stylecolor: #008000;>(/span>buffer, span stylecolor: #FF0000;>"TEXT TO"/span>span stylecolor: #008000;>)/span> span stylecolor: #000040;>&&/span> vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>sign_in/span> span stylecolor: #000080;>/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #666666;>//Le quitamos el TEXT TO/span> subCadenaspan stylecolor: #008000;>(/span>nombre, buffer, span stylecolor: #0000dd;>8/span>, MAXLINEspan stylecolor: #000040;>-/span>span stylecolor: #0000dd;>8/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>//Nos quedamos sólo con el nombre, quitando desde el primer espacio en blanco hasta el final/span> span stylecolor: #0000dd;>strtok/span>span stylecolor: #008000;>(/span>nombre,span stylecolor: #FF0000;>" "/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>//Se obtiene el socket destino/span> destino span stylecolor: #000080;>/span> buscarClientespan stylecolor: #008000;>(/span>nombrespan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> longitudspan stylecolor: #000080;>/span>span stylecolor: #0000dd;>strlen/span>span stylecolor: #008000;>(/span>nombrespan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcpy/span>span stylecolor: #008000;>(/span>nombre, vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>usuario/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>nombre, span stylecolor: #FF0000;>" dice: "/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #666666;>//Recortamos el TEXT TO, el nombre, y los dos espacios hasta el mensaje(se suma solo uno (un espacio) /span> span stylecolor: #666666;>//porque empieza a recorrer longitud(instruccion)+longitud(nombre) desde la pos. 0 de la cadena. /span> subCadenaspan stylecolor: #008000;>(/span>temp, buffer, span stylecolor: #0000dd;>8/span>span stylecolor: #000040;>+/span>longitudspan stylecolor: #000040;>+/span>span stylecolor: #0000dd;>1/span>, MAXLINEspan stylecolor: #000040;>-/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>8/span>span stylecolor: #000040;>+/span>longitudspan stylecolor: #000040;>+/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strcat/span>span stylecolor: #008000;>(/span>nombre, tempspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>destino span stylecolor: #000040;>!/span>span stylecolor: #000080;>/span> span stylecolor: #000040;>-/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> sendspan stylecolor: #008000;>(/span>destino, nombre, MAXLINE, span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000dd;>fflush/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>stdout/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> closespan stylecolor: #008000;>(/span>vectorClientesspan stylecolor: #008000;>[/span>idspan stylecolor: #008000;>]/span>.span stylecolor: #007788;>socket/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span>span stylecolor: #008000;>}/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>#include <stdio.h>#include <string.h>#include <sys/types.h>#include <unistd.h>#include <stdlib.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <pthread.h>#define SERVER_PORT 6543#define SERVER_ADDRESS "127.0.0.1"#define MAXLINE 512#define MAXCLIENTS 10int buscarCliente(char*);void subCadena(char*, char*, int, int);struct vector{ int socket; char usuarioMAXLINE-4; int sign_in;};struct vector vectorClientesMAXCLIENTS;int clientes 0;int main(int argc, char *argv){ void* gestionaCliente(void* p); int socketfd, new_sd; socklen_t client_len; struct sockaddr_in server_addr, client_addr; int i, status, id; pthread_t hilosMAXCLIENTS; for(i0;i<MAXCLIENTS;i++) strcpy(vectorClientesi.usuario, " "); // Open TCP internet STREAM socket if ((socketfd socket(AF_INET, SOCK_STREAM, 0)) < 0) perror("server: Cant open stream socket"); // Bind local address to allow the client to connect bzero((char *) &server_addr, sizeof(server_addr)); server_addr.sin_family AF_INET; server_addr.sin_addr.s_addr htonl(INADDR_ANY); server_addr.sin_port htons(SERVER_PORT); if (bind (socketfd, (struct sockaddr *) &server_addr, sizeof(server_addr)) < 0) perror("server: cant bind local address"); listen(socketfd, 5); for (;;) { client_len sizeof(client_addr); if((new_sd accept(socketfd, (struct sockaddr *) &client_addr, &client_len)) < 0) { printf("Error aceptando peticiones\n"); exit(0); } else { id clientes; vectorClientesid.socket new_sd; vectorClientesid.sign_in 0; fflush(stdout); clientes++; if ( (status pthread_create(&hilosid,NULL,gestionaCliente,(void *)&id)) ) { printf("Error al crear el hilo\n"); exit(0); } } } close(socketfd); // Close original socket return 0;}void subCadena(char *subCad, char *cad, int inicio, int cuantos){ int i,j0; for(iinicio;i<inicio+cuantos && cadi!\0;i++) { subCadjcadi; j++; } subCadj\0;}int buscarCliente(char* usuario){ int i; for(i0;i<clientes;i++) { if(strcmp(vectorClientesi.usuario,usuario ) 0 && vectorClientesi.sign_in 1) return vectorClientesi.socket; } return -1;}void* gestionaCliente(void* p){ int *ide, id; ide (int* ) p; id *ide; char bufferMAXLINE, nombreMAXLINE-4, tempMAXLINE-8; int i, longitud, destino; while(1) { recv(vectorClientesid.socket,buffer,MAXLINE,0); printf("\nid%d\n", id); if(strstr(buffer, "ADD") && vectorClientesid.sign_in 0) { longitud strlen(buffer); //Le quitamos el ADD subCadena(nombre, buffer, 4, longitud-4); strcpy(vectorClientesid.usuario, nombre); //Se informa a todos menos a él mismo y al que se haya ido strcpy(buffer, "El usuario "); strcat(buffer, nombre); strcat(buffer, " ha entrado en el chat."); for(i 0; i < clientes; i++) if (i ! id && vectorClientesi.sign_in 1) send(vectorClientesi.socket,buffer,MAXLINE,0); vectorClientesid.sign_in 1; } if(strstr(buffer, "LIST") && vectorClientesid.sign_in 1) { //Se envia al cliente todos los usuarios menos los que hayan abandonado la sesión for(i 0; i < clientes; i++){ if(vectorClientesi.sign_in 1) send(vectorClientesid.socket, vectorClientesi.usuario, MAXLINE, 0); } } if(strstr(buffer, "END") && vectorClientesid.sign_in 1) { //Se informa a todos menos a él mismo y al que se haya ido strcpy(buffer, "El usuario "); strcat(buffer, vectorClientesid.usuario); strcat(buffer, " ha abandonado en el chat."); bzero(vectorClientesid.usuario, MAXLINE); for(i 0; i < clientes; i++) if (i ! id && vectorClientesi.sign_in 1) send(vectorClientesi.socket,buffer,MAXLINE,0); vectorClientesid.sign_in 0; } if(strstr(buffer, "TEXT") && !strstr(buffer, "TEXT TO") && vectorClientesid.sign_in 1) { longitud strlen(buffer); subCadena(temp, buffer, 5, longitud-5); //Se envía a todos menos a él mismo y al que se haya ido bzero(buffer, MAXLINE); strcat(buffer, vectorClientesid.usuario); strcat(buffer, " dice: "); strcat(buffer, temp); for(i 0; i < clientes; i++) if (i ! id && vectorClientesi.sign_in 1) send(vectorClientesi.socket,buffer,MAXLINE,0); } if(strstr(buffer, "TEXT TO") && vectorClientesid.sign_in 1) { //Le quitamos el TEXT TO subCadena(nombre, buffer, 8, MAXLINE-8); //Nos quedamos sólo con el nombre, quitando desde el primer espacio en blanco hasta el final strtok(nombre," "); //Se obtiene el socket destino destino buscarCliente(nombre); longitudstrlen(nombre); strcpy(nombre, vectorClientesid.usuario); strcat(nombre, " dice: "); //Recortamos el TEXT TO, el nombre, y los dos espacios hasta el mensaje(se suma solo uno (un espacio) //porque empieza a recorrer longitud(instruccion)+longitud(nombre) desde la pos. 0 de la cadena. subCadena(temp, buffer, 8+longitud+1, MAXLINE-(8+longitud+1)); strcat(nombre, temp); if(destino ! -1) send(destino, nombre, MAXLINE, 0); } fflush(stdout); } close(vectorClientesid.socket);}/p>/div>h5>Cliente/h5>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485/pre>/td>td classcode>pre classcpp stylefont-family:monospace;>span stylecolor: #339900;>#include <stdio.h>/span>span stylecolor: #339900;>#include <stdlib.h>/span>span stylecolor: #339900;>#include <unistd.h>/span>span stylecolor: #339900;>#include <netinet/in.h>/span>span stylecolor: #339900;>#include <arpa/inet.h>/span>span stylecolor: #339900;>#include <netdb.h>/span>span stylecolor: #339900;>#include <sys/types.h>/span>span stylecolor: #339900;>#include <sys/socket.h>/span>span stylecolor: #339900;>#include <pthread.h>/span>span stylecolor: #339900;>#include <string.h>/span> span stylecolor: #339900;>#define SERVER_PORT 6543/span>span stylecolor: #339900;>#define SERVER_ADDRESS "127.0.0.1"/span>span stylecolor: #339900;>#define MAXLINE 512/span> span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> recibirspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> pspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> enviarspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> pspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> mainspan stylecolor: #008000;>(/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>struct/span> sockaddr_in addrspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>int/span> sd,statusspan stylecolor: #008080;>;/span> pthread_t hilosspan stylecolor: #008000;>[/span>span stylecolor: #0000dd;>2/span>span stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> addr.span stylecolor: #007788;>sin_family/span> span stylecolor: #000080;>/span> AF_INETspan stylecolor: #008080;>;/span> addr.span stylecolor: #007788;>sin_addr/span>.span stylecolor: #007788;>s_addr/span> span stylecolor: #000080;>/span> inet_addrspan stylecolor: #008000;>(/span>SERVER_ADDRESSspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> addr.span stylecolor: #007788;>sin_port/span> span stylecolor: #000080;>/span> htonsspan stylecolor: #008000;>(/span>SERVER_PORTspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>span stylecolor: #008000;>(/span>sd span stylecolor: #000080;>/span> socket span stylecolor: #008000;>(/span>AF_INET, SOCK_STREAM, span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span> span stylecolor: #000080;>/span> span stylecolor: #000040;>-/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"Error al crear el socketspan stylecolor: #000099; font-weight: bold;>\n/span>"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>exit/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>if/span>span stylecolor: #008000;>(/span>connectspan stylecolor: #008000;>(/span>sd, span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>struct/span> sockaddr span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span>span stylecolor: #000040;>&/span>addr, span stylecolor: #0000dd;>sizeof/span>span stylecolor: #008000;>(/span>addrspan stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span> span stylecolor: #000080;>/span> span stylecolor: #000040;>-/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"Error al conectarspan stylecolor: #000099; font-weight: bold;>\n/span>"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>exit/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>else/span> span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>if/span> span stylecolor: #008000;>(/span> span stylecolor: #008000;>(/span>status span stylecolor: #000080;>/span> pthread_createspan stylecolor: #008000;>(/span>span stylecolor: #000040;>&/span>hilosspan stylecolor: #008000;>[/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>]/span>,span stylecolor: #0000ff;>NULL/span>,recibir,span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span>span stylecolor: #000040;>&/span>sdspan stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"Error al crear hilo para recibirspan stylecolor: #000099; font-weight: bold;>\n/span>"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> closespan stylecolor: #008000;>(/span>sdspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>exit/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>if/span> span stylecolor: #008000;>(/span> span stylecolor: #008000;>(/span>status span stylecolor: #000080;>/span> pthread_createspan stylecolor: #008000;>(/span>span stylecolor: #000040;>&/span>hilosspan stylecolor: #008000;>[/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>]/span>,span stylecolor: #0000ff;>NULL/span>,enviar,span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span>span stylecolor: #000040;>&/span>sdspan stylecolor: #008000;>)/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"Error al crear hilo para enviarspan stylecolor: #000099; font-weight: bold;>\n/span>"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> closespan stylecolor: #008000;>(/span>sdspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>exit/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> pthread_joinspan stylecolor: #008000;>(/span>hilosspan stylecolor: #008000;>[/span>span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>]/span>,span stylecolor: #0000ff;>NULL/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> pthread_joinspan stylecolor: #008000;>(/span>hilosspan stylecolor: #008000;>[/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>]/span>,span stylecolor: #0000ff;>NULL/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>return/span> span stylecolor: #0000dd;>1/span>span stylecolor: #008080;>;/span>span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> recibirspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> pspan stylecolor: #008000;>)/span>span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>int/span>span stylecolor: #000040;>*/span> idspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>char/span> bufferspan stylecolor: #008000;>[/span>MAXLINEspan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> id span stylecolor: #000080;>/span> span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span> pspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>while/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> recvspan stylecolor: #008000;>(/span>span stylecolor: #000040;>*/span>id,buffer,MAXLINE,span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"%sspan stylecolor: #000099; font-weight: bold;>\n/span>"/span>,bufferspan stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>fflush/span>span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>stdout/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span>span stylecolor: #008000;>}/span> span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> enviarspan stylecolor: #008000;>(/span>span stylecolor: #0000ff;>void/span>span stylecolor: #000040;>*/span> pspan stylecolor: #008000;>)/span>span stylecolor: #008000;>{/span> span stylecolor: #0000ff;>int/span>span stylecolor: #000040;>*/span> idspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>char/span> bufferspan stylecolor: #008000;>[/span>MAXLINEspan stylecolor: #008000;>]/span>span stylecolor: #008080;>;/span> id span stylecolor: #000080;>/span> span stylecolor: #008000;>(/span>span stylecolor: #0000ff;>int/span>span stylecolor: #000040;>*/span>span stylecolor: #008000;>)/span> pspan stylecolor: #008080;>;/span> span stylecolor: #0000ff;>while/span>span stylecolor: #008000;>(/span>span stylecolor: #0000dd;>1/span>span stylecolor: #008000;>)/span> span stylecolor: #008000;>{/span> span stylecolor: #0000dd;>printf/span>span stylecolor: #008000;>(/span>span stylecolor: #FF0000;>"span stylecolor: #000099; font-weight: bold;>\t/span>Introduce el mensajespan stylecolor: #000099; font-weight: bold;>\n/span>-> "/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>fgets/span>span stylecolor: #008000;>(/span>buffer , MAXLINE , span stylecolor: #0000ff;>stdin/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #0000dd;>strtok/span>span stylecolor: #008000;>(/span>buffer,span stylecolor: #FF0000;>"span stylecolor: #000099; font-weight: bold;>\n/span>"/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> sendspan stylecolor: #008000;>(/span>span stylecolor: #000040;>*/span>id,buffer,MAXLINE,span stylecolor: #0000dd;>0/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> sleepspan stylecolor: #008000;>(/span>span stylecolor: #0000dd;>3/span>span stylecolor: #008000;>)/span>span stylecolor: #008080;>;/span> span stylecolor: #008000;>}/span>span stylecolor: #008000;>}/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <netinet/in.h>#include <arpa/inet.h>#include <netdb.h>#include <sys/types.h>#include <sys/socket.h>#include <pthread.h>#include <string.h>#define SERVER_PORT 6543#define SERVER_ADDRESS "127.0.0.1"#define MAXLINE 512void* recibir(void* p);void* enviar(void* p);int main(){ struct sockaddr_in addr; int sd,status; pthread_t hilos2; addr.sin_family AF_INET; addr.sin_addr.s_addr inet_addr(SERVER_ADDRESS); addr.sin_port htons(SERVER_PORT); if((sd socket (AF_INET, SOCK_STREAM, 0)) -1) { printf("Error al crear el socket\n"); exit(0); } if(connect(sd, (struct sockaddr *)&addr, sizeof(addr)) -1) { printf("Error al conectar\n"); exit(0); } else { if ( (status pthread_create(&hilos0,NULL,recibir,(void*)&sd)) ) { printf("Error al crear hilo para recibir\n"); close(sd); exit(0); } if ( (status pthread_create(&hilos1,NULL,enviar,(void*)&sd)) ) { printf("Error al crear hilo para enviar\n"); close(sd); exit(0); } pthread_join(hilos0,NULL); pthread_join(hilos1,NULL); } return 1;}void* recibir(void* p){ int* id; char bufferMAXLINE; id (int*) p; while(1) { recv(*id,buffer,MAXLINE,0); printf("%s\n",buffer); fflush(stdout); }}void* enviar(void* p){ int* id; char bufferMAXLINE; id (int*) p; while(1) { printf("\tIntroduce el mensaje\n-> "); fgets(buffer , MAXLINE , stdin); strtok(buffer,"\n"); send(*id,buffer,MAXLINE,0); sleep(3); }}/p>/div>p>img loadinglazy classalignnone wp-image-210 size-full srchttps://davidlopez.es/wp-content/uploads/2016/04/chat-en-c-2.png altchat-en-c-2 width996 height689 srcsethttps://davidlopez.es/wp-content/uploads/2016/04/chat-en-c-2.png 996w, https://davidlopez.es/wp-content/uploads/2016/04/chat-en-c-2-300x208.png 300w, https://davidlopez.es/wp-content/uploads/2016/04/chat-en-c-2-768x531.png 768w sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px />/p>h4>/h4>h4>/h4>h4>En Python/h4>h5>Servidor/h5>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980/pre>/td>td classcode>pre classpython stylefont-family:monospace;>span stylecolor: #808080; font-style: italic;>#!/usr/bin/python/span>span stylecolor: #808080; font-style: italic;># -*- coding: utf-8 -*-/span>span stylecolor: #808080; font-style: italic;>#Servidor/span> span stylecolor: #ff7700;font-weight:bold;>import/span> span stylecolor: #dc143c;>string/span>span stylecolor: #ff7700;font-weight:bold;>import/span> span stylecolor: #dc143c;>threading/span>span stylecolor: #ff7700;font-weight:bold;>import/span> span stylecolor: #dc143c;>socket/span> clientes span stylecolor: #66cc66;>/span> span stylecolor: black;>{/span>span stylecolor: #483d8b;>nombre/span>:span stylecolor: black;>[/span>span stylecolor: black;>]/span>span stylecolor: #66cc66;>,/span> span stylecolor: #483d8b;>socket/span>:span stylecolor: black;>[/span>span stylecolor: black;>]/span>span stylecolor: black;>}/span> span stylecolor: #ff7700;font-weight:bold;>class/span> gestionaClientesspan stylecolor: black;>(/span>span stylecolor: #dc143c;>threading/span>.span stylecolor: black;>Thread/span>span stylecolor: black;>)/span>: span stylecolor: #ff7700;font-weight:bold;>def/span> span stylecolor: #0000cd;>__init__/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: #66cc66;>,/span> span stylecolor: #dc143c;>socket/span>span stylecolor: black;>)/span>: span stylecolor: #dc143c;>threading/span>.span stylecolor: black;>Thread/span>.span stylecolor: #0000cd;>__init__/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span> span stylecolor: #66cc66;>/span> span stylecolor: #dc143c;>socket/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conectado/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>False/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span> span stylecolor: #66cc66;>/span> span stylecolor: #483d8b;>/span> span stylecolor: #ff7700;font-weight:bold;>def/span> runspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: black;>)/span>: span stylecolor: #ff7700;font-weight:bold;>while/span> span stylecolor: #008000;>True/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>recv/span>span stylecolor: black;>(/span> span stylecolor: #ff4500;>1024/span> span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>if/span> span stylecolor: #483d8b;>ADD/span> span stylecolor: #ff7700;font-weight:bold;>in/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>: span stylecolor: #808080; font-style: italic;>#Busca si ya ha sido insertado/span> span stylecolor: #ff7700;font-weight:bold;>if/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conectado/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>False/span>span stylecolor: black;>)/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>conectado/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>True/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>nombre/span>span stylecolor: black;>]/span>.span stylecolor: black;>append/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>span stylecolor: black;>[/span>span stylecolor: #ff4500;>4/span>:span stylecolor: black;>]/span>span stylecolor: black;>)/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>.span stylecolor: black;>append/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>for/span> i span stylecolor: #ff7700;font-weight:bold;>in/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>: span stylecolor: #ff7700;font-weight:bold;>if/span> i span stylecolor: #66cc66;>!/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>: i.span stylecolor: black;>send/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>span stylecolor: black;>[/span>span stylecolor: #ff4500;>4/span>:span stylecolor: black;>]/span>+span stylecolor: #483d8b;>" ha entrado en el chat."/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>else/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>send/span>span stylecolor: black;>(/span>span stylecolor: #483d8b;>"Ya estás en el chat."/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>print/span> clientes span stylecolor: #ff7700;font-weight:bold;>if/span> span stylecolor: black;>(/span>span stylecolor: #483d8b;>LIST/span> span stylecolor: #ff7700;font-weight:bold;>in/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>and/span> span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conectado/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>True/span>span stylecolor: black;>)/span>: span stylecolor: #ff7700;font-weight:bold;>for/span> i span stylecolor: #ff7700;font-weight:bold;>in/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>nombre/span>span stylecolor: black;>]/span>: span stylecolor: #ff7700;font-weight:bold;>print/span> span stylecolor: #483d8b;>"enviado a "/span>+span stylecolor: #008000;>str/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>span stylecolor: black;>)/span>+span stylecolor: #483d8b;>" "/span>+span stylecolor: #008000;>str/span>span stylecolor: black;>(/span>ispan stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>send/span>span stylecolor: black;>(/span>i+span stylecolor: #483d8b;>" "/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>print/span> clientes span stylecolor: #ff7700;font-weight:bold;>if/span> span stylecolor: black;>(/span>span stylecolor: #483d8b;>END/span> span stylecolor: #ff7700;font-weight:bold;>in/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>span stylecolor: black;>)/span>: span stylecolor: #ff7700;font-weight:bold;>if/span> span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conectado/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>True/span>span stylecolor: black;>)/span>: span stylecolor: #ff7700;font-weight:bold;>for/span> i span stylecolor: #ff7700;font-weight:bold;>in/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>: span stylecolor: #ff7700;font-weight:bold;>if/span> i span stylecolor: #66cc66;>/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>: nombre span stylecolor: #66cc66;>/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>nombre/span>span stylecolor: black;>]/span>span stylecolor: black;>[/span>clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>.span stylecolor: black;>index/span>span stylecolor: black;>(/span>ispan stylecolor: black;>)/span>span stylecolor: black;>]/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>nombre/span>span stylecolor: black;>]/span>.span stylecolor: black;>remove/span>span stylecolor: black;>(/span>nombrespan stylecolor: black;>)/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>.span stylecolor: black;>remove/span>span stylecolor: black;>(/span>ispan stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conectado/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>False/span> span stylecolor: #ff7700;font-weight:bold;>for/span> i span stylecolor: #ff7700;font-weight:bold;>in/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>: span stylecolor: #ff7700;font-weight:bold;>if/span> i span stylecolor: #66cc66;>!/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>: i.span stylecolor: black;>send/span>span stylecolor: black;>(/span>nombre+span stylecolor: #483d8b;>" ha salido del chat."/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>send/span>span stylecolor: black;>(/span>span stylecolor: #483d8b;>" "/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>else/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>send/span>span stylecolor: black;>(/span>span stylecolor: #483d8b;>" "/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>if/span> span stylecolor: black;>(/span>span stylecolor: #483d8b;>TEXT/span> span stylecolor: #ff7700;font-weight:bold;>in/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span> span stylecolor: #ff7700;font-weight:bold;>and/span> span stylecolor: #483d8b;>TEXT TO/span> span stylecolor: #ff7700;font-weight:bold;>not/span> span stylecolor: #ff7700;font-weight:bold;>in/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>and/span> span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conectado/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>True/span>span stylecolor: black;>)/span>: span stylecolor: #ff7700;font-weight:bold;>for/span> i span stylecolor: #ff7700;font-weight:bold;>in/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>: span stylecolor: #ff7700;font-weight:bold;>if/span> i span stylecolor: #66cc66;>!/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>: i.span stylecolor: black;>send/span>span stylecolor: black;>(/span>clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>nombre/span>span stylecolor: black;>]/span>span stylecolor: black;>[/span>clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>.span stylecolor: black;>index/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>span stylecolor: black;>)/span>span stylecolor: black;>]/span>+span stylecolor: #483d8b;>" dice: "/span>+span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>span stylecolor: black;>[/span>span stylecolor: #ff4500;>5/span>:span stylecolor: black;>]/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>print/span> clientes span stylecolor: #ff7700;font-weight:bold;>if/span> span stylecolor: black;>(/span>span stylecolor: #483d8b;>TEXT TO/span> span stylecolor: #ff7700;font-weight:bold;>in/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>and/span> span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conectado/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>True/span>span stylecolor: black;>)/span>: palabras span stylecolor: #66cc66;>/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>data/span>span stylecolor: black;>[/span>span stylecolor: #ff4500;>8/span>:span stylecolor: black;>]/span>.span stylecolor: black;>split/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span> span stylecolor: #808080; font-style: italic;>#busca si existe alguien con ese alias/span> span stylecolor: #ff7700;font-weight:bold;>for/span> i span stylecolor: #ff7700;font-weight:bold;>in/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>nombre/span>span stylecolor: black;>]/span>: span stylecolor: #ff7700;font-weight:bold;>if/span> i span stylecolor: #66cc66;>/span> palabrasspan stylecolor: black;>[/span>span stylecolor: #ff4500;>0/span>span stylecolor: black;>]/span>: span stylecolor: #808080; font-style: italic;>#Prepara el mensaje/span> span stylecolor: #ff7700;font-weight:bold;>del/span> palabrasspan stylecolor: black;>[/span>span stylecolor: #ff4500;>0/span>span stylecolor: black;>]/span> mensaje span stylecolor: #66cc66;>/span> span stylecolor: #dc143c;>string/span>.span stylecolor: black;>join/span>span stylecolor: black;>(/span>palabrasspan stylecolor: #66cc66;>,/span> span stylecolor: #483d8b;> /span>span stylecolor: black;>)/span> clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>span stylecolor: black;>[/span>clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>nombre/span>span stylecolor: black;>]/span>.span stylecolor: black;>index/span>span stylecolor: black;>(/span>ispan stylecolor: black;>)/span>span stylecolor: black;>]/span>.span stylecolor: black;>send/span>span stylecolor: black;>(/span>clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>nombre/span>span stylecolor: black;>]/span>span stylecolor: black;>[/span>clientesspan stylecolor: black;>[/span>span stylecolor: #483d8b;>socket/span>span stylecolor: black;>]/span>.span stylecolor: black;>index/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>span stylecolor: black;>)/span>span stylecolor: black;>]/span>+span stylecolor: #483d8b;>" dice: "/span>+mensajespan stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>close/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span> span stylecolor: #808080; font-style: italic;>#creamos socket pasivo y escuchamos en el puerto 9000/span>s span stylecolor: #66cc66;>/span> span stylecolor: #dc143c;>socket/span>.span stylecolor: #dc143c;>socket/span>span stylecolor: black;>(/span> span stylecolor: #dc143c;>socket/span>.span stylecolor: black;>AF_INET/span>span stylecolor: #66cc66;>,/span> span stylecolor: #dc143c;>socket/span>.span stylecolor: black;>SOCK_STREAM/span> span stylecolor: black;>)/span>s.span stylecolor: black;>bind/span>span stylecolor: black;>(/span> span stylecolor: black;>(/span> span stylecolor: #dc143c;>socket/span>.span stylecolor: black;>gethostname/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span>span stylecolor: #66cc66;>,/span> span stylecolor: #ff4500;>9000/span> span stylecolor: black;>)/span> span stylecolor: black;>)/span>s.span stylecolor: black;>listen/span>span stylecolor: black;>(/span> span stylecolor: #ff4500;>5/span> span stylecolor: black;>)/span>span stylecolor: #ff7700;font-weight:bold;>while/span>span stylecolor: black;>(/span>span stylecolor: #008000;>True/span>span stylecolor: black;>)/span>: connspan stylecolor: #66cc66;>,/span> addr span stylecolor: #66cc66;>/span> s.span stylecolor: black;>accept/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span> gestionaClientesspan stylecolor: black;>(/span>connspan stylecolor: black;>)/span>.span stylecolor: black;>start/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>#!/usr/bin/python# -*- coding: utf-8 -*-#Servidorimport stringimport threadingimport socketclientes {nombre:, socket:}class gestionaClientes(threading.Thread): def __init__(self, socket): threading.Thread.__init__(self) self.conn socket self.conectado False self.data def run(self): while True: self.data self.conn.recv( 1024 ) if ADD in self.data: #Busca si ya ha sido insertado if(self.conectado False): self.conectado True clientesnombre.append(self.data4:) clientessocket.append(self.conn) for i in clientessocket: if i ! self.conn: i.send(self.data4:+" ha entrado en el chat.") else: self.conn.send("Ya estás en el chat.") print clientes if (LIST in self.data) and (self.conectado True): for i in clientesnombre: print "enviado a "+str(self.conn)+" "+str(i) self.conn.send(i+" ") print clientes if (END in self.data): if (self.conectado True): for i in clientessocket: if i self.conn: nombre clientesnombreclientessocket.index(i) clientesnombre.remove(nombre) clientessocket.remove(i) self.conectado False for i in clientessocket: if i ! self.conn: i.send(nombre+" ha salido del chat.") self.conn.send(" ") else: self.conn.send(" ") if (TEXT in self.data and TEXT TO not in self.data) and (self.conectado True): for i in clientessocket: if i ! self.conn: i.send(clientesnombreclientessocket.index(self.conn)+" dice: "+self.data5:) print clientes if (TEXT TO in self.data) and (self.conectado True): palabras self.data8:.split() #busca si existe alguien con ese alias for i in clientesnombre: if i palabras0: #Prepara el mensaje del palabras0 mensaje string.join(palabras, ) clientessocketclientesnombre.index(i).send(clientesnombreclientessocket.index(self.conn)+" dice: "+mensaje) self.conn.close() #creamos socket pasivo y escuchamos en el puerto 9000s socket.socket( socket.AF_INET, socket.SOCK_STREAM )s.bind( ( socket.gethostname(), 9000 ) )s.listen( 5 )while(True): conn, addr s.accept() gestionaClientes(conn).start()/p>/div>h5>Cliente/h5>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374/pre>/td>td classcode>pre classpython stylefont-family:monospace;>span stylecolor: #808080; font-style: italic;>#!/usr/bin/python/span>span stylecolor: #808080; font-style: italic;># -*- coding: utf-8 -*-/span>span stylecolor: #808080; font-style: italic;>#Cliente/span> span stylecolor: #ff7700;font-weight:bold;>from/span> span stylecolor: #dc143c;>Tkinter/span> span stylecolor: #ff7700;font-weight:bold;>import/span> *span stylecolor: #ff7700;font-weight:bold;>import/span> span stylecolor: #dc143c;>threading/span>span stylecolor: #ff7700;font-weight:bold;>import/span> span stylecolor: #dc143c;>socket/span> span stylecolor: #ff7700;font-weight:bold;>class/span> App: span stylecolor: #ff7700;font-weight:bold;>def/span> span stylecolor: #0000cd;>__init__/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: #66cc66;>,/span> masterspan stylecolor: #66cc66;>,/span> span stylecolor: #dc143c;>socket/span>span stylecolor: black;>)/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span> span stylecolor: #66cc66;>/span> span stylecolor: #dc143c;>socket/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span> span stylecolor: #66cc66;>/span> Framespan stylecolor: black;>(/span>masterspan stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>label/span> span stylecolor: #66cc66;>/span> Labelspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span>span stylecolor: #66cc66;>,/span> textspan stylecolor: #66cc66;>/span>span stylecolor: #483d8b;>"Cliente chat. Python+TkInter. David López"/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>textarea/span> span stylecolor: #66cc66;>/span> Textspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span>span stylecolor: #66cc66;>,/span> heightspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>20/span>span stylecolor: #66cc66;>,/span> widthspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>40/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>scroll/span> span stylecolor: #66cc66;>/span> Scrollbarspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span>span stylecolor: #66cc66;>,/span> commandspan stylecolor: #66cc66;>/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>textarea/span>.span stylecolor: black;>yview/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>textarea/span>.span stylecolor: black;>configure/span>span stylecolor: black;>(/span>yscrollcommandspan stylecolor: #66cc66;>/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>scroll/span>.span stylecolor: #008000;>set/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>texto_enviar/span> span stylecolor: #66cc66;>/span> StringVarspan stylecolor: black;>(/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>text_ent/span> span stylecolor: #66cc66;>/span> Entryspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span>span stylecolor: #66cc66;>,/span> textvariablespan stylecolor: #66cc66;>/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>texto_enviar/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>btn_enviar/span> span stylecolor: #66cc66;>/span> Buttonspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span>span stylecolor: #66cc66;>,/span> textspan stylecolor: #66cc66;>/span>span stylecolor: #483d8b;>"Enviar"/span>span stylecolor: #66cc66;>,/span> commandspan stylecolor: #66cc66;>/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>enviar/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>btn_salir/span> span stylecolor: #66cc66;>/span> Buttonspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span>span stylecolor: #66cc66;>,/span> textspan stylecolor: #66cc66;>/span>span stylecolor: #483d8b;>"Salir"/span>span stylecolor: #66cc66;>,/span> commandspan stylecolor: #66cc66;>/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>salir/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span>.span stylecolor: black;>grid/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>label/span>.span stylecolor: black;>grid/span>span stylecolor: black;>(/span>rowspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>0/span>span stylecolor: #66cc66;>,/span> columnspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>0/span>span stylecolor: #66cc66;>,/span> columnspanspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>3/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>textarea/span>.span stylecolor: black;>grid/span>span stylecolor: black;>(/span>rowspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>1/span>span stylecolor: #66cc66;>,/span> columnspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>0/span>span stylecolor: #66cc66;>,/span> columnspanspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>2/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>scroll/span>.span stylecolor: black;>grid/span>span stylecolor: black;>(/span>rowspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>1/span>span stylecolor: #66cc66;>,/span> columnspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>2/span>span stylecolor: #66cc66;>,/span> stickyspan stylecolor: #66cc66;>/span>N+Sspan stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>text_ent/span>.span stylecolor: black;>grid/span>span stylecolor: black;>(/span>rowspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>2/span>span stylecolor: #66cc66;>,/span> columnspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>0/span>span stylecolor: #66cc66;>,/span> columnspanspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>2/span>span stylecolor: #66cc66;>,/span> stickyspan stylecolor: #66cc66;>/span>W+Espan stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>btn_enviar/span>.span stylecolor: black;>grid/span>span stylecolor: black;>(/span>rowspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>3/span>span stylecolor: #66cc66;>,/span> columnspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>0/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>btn_salir/span>.span stylecolor: black;>grid/span>span stylecolor: black;>(/span>rowspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>3/span>span stylecolor: #66cc66;>,/span> columnspan stylecolor: #66cc66;>/span>span stylecolor: #ff4500;>1/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>def/span> enviarspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: black;>)/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>send/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>text_ent/span>.span stylecolor: black;>get/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>text_ent/span>.span stylecolor: black;>delete/span>span stylecolor: black;>(/span>span stylecolor: #ff4500;>0/span>span stylecolor: #66cc66;>,/span> ENDspan stylecolor: black;>)/span> span stylecolor: #808080; font-style: italic;># Esta es una función de retrollamada./span> span stylecolor: #ff7700;font-weight:bold;>def/span> salirspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: black;>)/span>: lee.span stylecolor: black;>parar/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>send/span>span stylecolor: black;>(/span>span stylecolor: #483d8b;>"END"/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>frame/span>.span stylecolor: black;>quit/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>def/span> escribirspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: #66cc66;>,/span> textospan stylecolor: black;>)/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>textarea/span>.span stylecolor: black;>insert/span>span stylecolor: black;>(/span>ENDspan stylecolor: #66cc66;>,/span> textospan stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>class/span> leerspan stylecolor: black;>(/span>span stylecolor: #dc143c;>threading/span>.span stylecolor: black;>Thread/span>span stylecolor: black;>)/span>: span stylecolor: #ff7700;font-weight:bold;>def/span> span stylecolor: #0000cd;>__init__/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: #66cc66;>,/span> span stylecolor: #dc143c;>socket/span>span stylecolor: black;>)/span>: span stylecolor: #dc143c;>threading/span>.span stylecolor: black;>Thread/span>.span stylecolor: #0000cd;>__init__/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>mensaje/span> span stylecolor: #66cc66;>/span> span stylecolor: #483d8b;>/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span> span stylecolor: #66cc66;>/span> span stylecolor: #dc143c;>socket/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>stop/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>False/span> span stylecolor: #ff7700;font-weight:bold;>def/span> runspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: black;>)/span>: span stylecolor: #ff7700;font-weight:bold;>while/span> span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>stop/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>False/span>span stylecolor: black;>)/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>mensaje/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>recv/span>span stylecolor: black;>(/span> span stylecolor: #ff4500;>1024/span> span stylecolor: black;>)/span> app.span stylecolor: black;>escribir/span>span stylecolor: black;>(/span>span stylecolor: #008000;>self/span>.span stylecolor: black;>mensaje/span>+span stylecolor: #483d8b;>span stylecolor: #000099; font-weight: bold;>\n/span>/span>span stylecolor: black;>)/span> span stylecolor: #008000;>self/span>.span stylecolor: black;>conn/span>.span stylecolor: black;>close/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span> span stylecolor: #ff7700;font-weight:bold;>def/span> pararspan stylecolor: black;>(/span>span stylecolor: #008000;>self/span>span stylecolor: black;>)/span>: span stylecolor: #008000;>self/span>.span stylecolor: black;>stop/span> span stylecolor: #66cc66;>/span> span stylecolor: #008000;>True/span> miSocket span stylecolor: #66cc66;>/span> span stylecolor: #dc143c;>socket/span>.span stylecolor: #dc143c;>socket/span>span stylecolor: black;>(/span> span stylecolor: #dc143c;>socket/span>.span stylecolor: black;>AF_INET/span>span stylecolor: #66cc66;>,/span> span stylecolor: #dc143c;>socket/span>.span stylecolor: black;>SOCK_STREAM/span> span stylecolor: black;>)/span>miSocket.span stylecolor: black;>connect/span>span stylecolor: black;>(/span> span stylecolor: black;>(/span>span stylecolor: #dc143c;>socket/span>.span stylecolor: black;>gethostname/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span>span stylecolor: #66cc66;>,/span> span stylecolor: #ff4500;>9000/span> span stylecolor: black;>)/span> span stylecolor: black;>)/span> lee span stylecolor: #66cc66;>/span> leerspan stylecolor: black;>(/span>miSocketspan stylecolor: black;>)/span> lee.span stylecolor: black;>start/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span> root span stylecolor: #66cc66;>/span> Tkspan stylecolor: black;>(/span>span stylecolor: black;>)/span>root.span stylecolor: black;>title/span>span stylecolor: black;>(/span>span stylecolor: #483d8b;>Chat Python-TkInter - David López/span>span stylecolor: black;>)/span>app span stylecolor: #66cc66;>/span> Appspan stylecolor: black;>(/span>rootspan stylecolor: #66cc66;>,/span> miSocketspan stylecolor: black;>)/span> root.span stylecolor: black;>mainloop/span>span stylecolor: black;>(/span>span stylecolor: black;>)/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>#!/usr/bin/python# -*- coding: utf-8 -*-#Clientefrom Tkinter import *import threadingimport socketclass App: def __init__(self, master, socket): self.conn socket self.frame Frame(master) self.label Label(self.frame, text"Cliente chat. Python+TkInter. David López") self.textarea Text(self.frame, height20, width40) self.scroll Scrollbar(self.frame, commandself.textarea.yview) self.textarea.configure(yscrollcommandself.scroll.set) self.texto_enviar StringVar() self.text_ent Entry(self.frame, textvariableself.texto_enviar) self.btn_enviar Button(self.frame, text"Enviar", commandself.enviar) self.btn_salir Button(self.frame, text"Salir", commandself.salir) self.frame.grid() self.label.grid(row0, column0, columnspan3) self.textarea.grid(row1, column0, columnspan2) self.scroll.grid(row1, column2, stickyN+S) self.text_ent.grid(row2, column0, columnspan2, stickyW+E) self.btn_enviar.grid(row3, column0) self.btn_salir.grid(row3, column1) def enviar(self): self.conn.send(self.text_ent.get()) self.text_ent.delete(0, END) # Esta es una función de retrollamada. def salir(self): lee.parar() self.conn.send("END") self.frame.quit() def escribir(self, texto): self.textarea.insert(END, texto)class leer(threading.Thread): def __init__(self, socket): threading.Thread.__init__(self) self.mensaje self.conn socket self.stop False def run(self): while (self.stop False): self.mensaje self.conn.recv( 1024 ) app.escribir(self.mensaje+\n) self.conn.close() def parar(self): self.stop TruemiSocket socket.socket( socket.AF_INET, socket.SOCK_STREAM )miSocket.connect( (socket.gethostname(), 9000 ) )lee leer(miSocket)lee.start()root Tk()root.title(Chat Python-TkInter - David López)app App(root, miSocket)root.mainloop()/p>/div>p> /p>p> /p>p>img loadinglazy classalignnone wp-image-170 size-full srchttps://davidlopez.es/wp-content/uploads/2016/04/chatgrafico.png altchatgrafico width981 height599 srcsethttps://davidlopez.es/wp-content/uploads/2016/04/chatgrafico.png 981w, https://davidlopez.es/wp-content/uploads/2016/04/chatgrafico-300x183.png 300w, https://davidlopez.es/wp-content/uploads/2016/04/chatgrafico-768x469.png 768w sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px />/p> /div>!-- .entry-content --> /article>!-- #post-169 -->article idpost-163 classpost-163 post type-post status-publish format-standard has-post-thumbnail hentry category-sistemas-operativos tag-boot tag-grub tag-sistemas-operativos> header classentry-header> div classentry-meta>span classscreen-reader-text>Publicado el/span> a hrefhttps://davidlopez.es/cambiar-el-fondo-de-grub-2-0-con-grub-customizer/ relbookmark>time classentry-date published datetime2016-04-20T00:08:57+00:00>20 abril, 2016/time>time classupdated datetime2016-04-20T00:09:34+00:00>20 abril, 2016/time>/a>/div>!-- .entry-meta -->h2 classentry-title>a hrefhttps://davidlopez.es/cambiar-el-fondo-de-grub-2-0-con-grub-customizer/ relbookmark>Cambiar el fondo de Grub 2.0 con Grub-customizer/a>/h2> /header>!-- .entry-header --> div classpost-thumbnail> a hrefhttps://davidlopez.es/cambiar-el-fondo-de-grub-2-0-con-grub-customizer/> img width1600 height1200 srchttps://davidlopez.es/wp-content/uploads/2016/04/grub.jpg classattachment-twentyseventeen-featured-image size-twentyseventeen-featured-image wp-post-image alt loadinglazy srcsethttps://davidlopez.es/wp-content/uploads/2016/04/grub.jpg 1600w, https://davidlopez.es/wp-content/uploads/2016/04/grub-300x225.jpg 300w, https://davidlopez.es/wp-content/uploads/2016/04/grub-768x576.jpg 768w, https://davidlopez.es/wp-content/uploads/2016/04/grub-1024x768.jpg 1024w sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px /> /a> /div>!-- .post-thumbnail --> div classentry-content> p>Hay bastantes mejoras en Grub Customizer 2.0. Entre ellas, la posibilidad de seleccionar la entrada por defecto que está seleccionada para arrancar, el tiempo límite de interacción, o el establecimiento de parámetros del núcleo./p>p>Además en el caso de Grub 2.0 hay algunas características especiales como cambiar los colores del menú o la imagen de fondo. Para instalar la aplicación en Ubuntu podéis hacer lo siguiente:/p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #c20cb9; font-weight: bold;>sudo/span> add-apt-repository ppa:danielrichter2007span stylecolor: #000000; font-weight: bold;>//span>grub-customizerspan stylecolor: #c20cb9; font-weight: bold;>sudo/span> span stylecolor: #c20cb9; font-weight: bold;>apt-get update/span>span stylecolor: #c20cb9; font-weight: bold;>sudo/span> span stylecolor: #c20cb9; font-weight: bold;>apt-get install/span> grub-customizer/pre>/td>/tr>/table>p classtheCode styledisplay:none;>sudo add-apt-repository ppa:danielrichter2007/grub-customizersudo apt-get updatesudo apt-get install grub-customizer/p>/div>p>Y a partir de ahí podréis lanzar la aplicación desde terminal o con el menú Aplicaciones/Herramientas de Sistema/Grub Customizer./p>p>img loadinglazy classalignnone size-medium wp-image-164 srchttps://davidlopez.es/wp-content/uploads/2016/04/grub-300x225.jpg altgrub width300 height225 srcsethttps://davidlopez.es/wp-content/uploads/2016/04/grub-300x225.jpg 300w, https://davidlopez.es/wp-content/uploads/2016/04/grub-768x576.jpg 768w, https://davidlopez.es/wp-content/uploads/2016/04/grub-1024x768.jpg 1024w, https://davidlopez.es/wp-content/uploads/2016/04/grub.jpg 1600w sizes(max-width: 300px) 100vw, 300px />/p> /div>!-- .entry-content --> /article>!-- #post-163 -->article idpost-134 classpost-134 post type-post status-publish format-standard has-post-thumbnail hentry category-programacion tag-client tag-rpc tag-server tag-xdr> header classentry-header> div classentry-meta>span classscreen-reader-text>Publicado el/span> a hrefhttps://davidlopez.es/134/ relbookmark>time classentry-date published datetime2016-04-19T23:05:29+00:00>19 abril, 2016/time>time classupdated datetime2016-04-24T23:38:04+00:00>24 abril, 2016/time>/a>/div>!-- .entry-meta -->h2 classentry-title>a hrefhttps://davidlopez.es/134/ relbookmark>Llamadas a procedimiento remoto (RPC): Un servidor horario/a>/h2> /header>!-- .entry-header --> div classpost-thumbnail> a hrefhttps://davidlopez.es/134/> img width779 height623 srchttps://davidlopez.es/wp-content/uploads/2016/04/rpc.png classattachment-twentyseventeen-featured-image size-twentyseventeen-featured-image wp-post-image alt loadinglazy srcsethttps://davidlopez.es/wp-content/uploads/2016/04/rpc.png 779w, https://davidlopez.es/wp-content/uploads/2016/04/rpc-300x240.png 300w, https://davidlopez.es/wp-content/uploads/2016/04/rpc-768x614.png 768w sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px /> /a> /div>!-- .post-thumbnail --> div classentry-content> p styletext-align: justify; alignjustify>strong>RPC/strong> (Remote Procedure Call) es una tecnología, tradicionalmente empleada en ambiente UNIX, que permite el desarrollo de sistemas de procesamiento distribuido basados en el paradigma procedimental./p>p styletext-align: justify; alignjustify>Una llamada a un procedimiento (función o subrutina) es un método bien conocido para transferir el control de una parte del programa a otra, con un retorno del control a la primera. Asociado con la llamada a un procedimiento están el pase de argumentos y el retorno de uno o varios resultados. Cuando el código que invoca a un procedimiento y dicho procedimiento están en un mismo proceso en un computador dado, se dice que ha ocurrido una llamada a un procedimiento local./p>p styletext-align: justify; alignjustify>Por el contrario, en una llamada a un procedimiento remoto (RPC, Remote Proceure Call) el sistema local invoca, a través de la red, a una función alojada en otro sistema. Lo que se pretende es hacerle parecer al programador que está ocurriendo una simple llamada local. Este es el flujo de datos en el modelo RPC:/p>p styletext-align: justify; alignjustify>img loadinglazy classwp-image-140 size-full aligncenter srchttps://davidlopez.es/wp-content/uploads/2016/04/rpc.png altrpc width779 height623 srcsethttps://davidlopez.es/wp-content/uploads/2016/04/rpc.png 779w, https://davidlopez.es/wp-content/uploads/2016/04/rpc-300x240.png 300w, https://davidlopez.es/wp-content/uploads/2016/04/rpc-768x614.png 768w sizes(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px />/p>p styletext-align: justify;>Para este ejemplo se va a asumir que el entorno de trabajo ahora mismo es linux con gcc y rpcgen instalado.Los pasos para hacer que todo funcione son 4, y se describen a continuación:/p>ol>li styletext-align: justify;>La definición del XDR, usando ese lenguaje para especificar qué funciones quiere “publicar” el servidor, y cómo se han de llamar por parte del cliente./li>li styletext-align: justify;>La implementación de los métodos remotos, para tener un código que ejecutar cuando nos hagan una llamada remota./li>li styletext-align: justify;>La implementación de un cliente que invoque los métodos del servidor./li>li styletext-align: justify;>La compilación de todo esto y una ejecución de prueba./li>/ol>h2>/h2>h2>XDR/h2>p styletext-align: justify;>XDR (External Data Representation) es un estándar para la descripción y codificación de datos que utiliza un lenguaje cuya sintaxis es similar a la del lenguaje de programación C. Es empleado principalmente en la transferencia de información entre diferentes arquitecturas computacionales y se ubica dentro de la capa de presentación del modelo ISO. Involucra un mecanismo de tipificado implícito (Implicit Typing), es decir que sólo viaja el valor de la variable por la red./p>p styletext-align: justify;>Es importante resaltar que XDR no es un lenguaje de programación, sino una especificación que incluye un lenguaje de descripción de datos el cual es extendido por ONC-RPC para la definición de procedimientos remotos. Los tipos de datos de XDR presentan cierta similitud con los tipos de datos de C. Algunos de estos son:/p>ul>li>int/li>li>unsigned int/li>li>enum/li>li>bool/li>li>hyper/li>li>unsigned hyper/li>li>float/li>li>double/li>li>quadruple (punto flotante de cuádruple precisión)/li>li>opaque (de longitud fija o variable)/li>li>string/li>li>array (de longitud fija o variable)/li>li>struct/li>li>union (uniones discriminadas)/li>li>void/li>li>constant/li>/ul>p>El lenguaje especificado por RPC es idéntico al lenguaje de XDR, excepto que agrega la definición de «programa», cuya gramática es mostrada a continuación:/p>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>123456789101112131415/pre>/td>td classcode>pre classrpc stylefont-family:monospace;>program-def: "program" identifier "{" version-def version-def * "}" "" constant ";" version-def: "version" identifier "{" procedure-def procedure-def * "}" "" constant ";" procedure-def: type-specifier identifier "(" type-specifier("," type-specifier )* ")" "" constant ";"/pre>/td>/tr>/table>p classtheCode styledisplay:none;>program-def: "program" identifier "{" version-def version-def * "}" "" constant ";"version-def: "version" identifier "{" procedure-def procedure-def * "}" "" constant ";"procedure-def: type-specifier identifier "(" type-specifier("," type-specifier )* ")" "" constant ";"/p>/div>p>Lo primero es definir qué métodos está ofreciendo el servidor así como los parámetros que admite y el tipo de retorno. Esto lo hacemos en un fichero .x como el siguiente:/p>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>12345/pre>/td>td classcode>pre classrpc stylefont-family:monospace;>program HORA_PROG {version HORA_VERS {string HORA(void) 1; /*devuelve una cadena*/} 1;} 0x31230000;/pre>/td>/tr>/table>p classtheCode styledisplay:none;>program HORA_PROG {version HORA_VERS {string HORA(void) 1; /*devuelve una cadena*/} 1;} 0x31230000;/p>/div>p styletext-align: justify;>Las partes importantes del fichero son la definición de la estructura Operandos (en el anterior ejemplo no la hay) y el program { version { con las definiciones de las funciones. La definición de Operandos permite definir estructuras prácticamente arbitrarias como tipos para parámetros y retornos. Un ejemplo de fichero XDR con definición de operandos sería el siguiente, aunque no se usa en esta ocasión:/p>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>123456789/pre>/td>td classcode>pre classxdr stylefont-family:monospace;>struct hora {char arg90;}; program HORA_PROG {version HORA_VERS {hora HORA(void) 1; /*devuelve una cadena*/} 1;} 0x31230000;/pre>/td>/tr>/table>p classtheCode styledisplay:none;>struct hora {char arg90;};program HORA_PROG {version HORA_VERS {hora HORA(void) 1; /*devuelve una cadena*/} 1;} 0x31230000;/p>/div>p styletext-align: justify;>Los program son una manera de agrupar primitivas (he usado el convenio de notación de Sun para nombrarlo). El valor 0×31230000 es un identificador único para el servicio, de manera que que pueda ser localizado por el cliente y el servidor./p>p styletext-align: justify;>Dentro de program, tenemos una version que es la que contiene los métodos. Esto es así porque RPC admite varias versiones de los métodos para un mismo programa (por motivos de compatibilidad hacia atrás, entre otros). En este caso tenemos una única (la 1)./p>p styletext-align: justify;>Las definiciones de las funciones son prácticamente iguales a las que haríamos en C, con una consideración adicional (para este caso): a la hora de devolver una cadena no devolvemos char*, sino string. El convenio de Sun que impone poner aquí los nombres de las funciones en mayúscula. Si devolvemos un operando definido, simplemente se escribe antes del nombre de la función (hora). Por tanto, una vez terminada esta parte, he definido un servicio con una primitiva que devuelve la hora./p>h2 styletext-align: justify;>Implementación del servidor/h2>p styletext-align: justify;>El siguiente paso es la implementación del servidor; necesitamos crear el código que se ejecutará efectivamente en la máquina remota. Lo bueno de este sistema es que podemos hacer esencialmente lo que queramos: consultar bases de datos, reaizar cálculos, invocar otros servicios remotos, etc. De este modo, los procedimientos RPC pueden ser usados como rutinas de computación, de administración/gestion u obtención de datos./p>p styletext-align: justify;>En este caso, por tener un ejemplo concreto, la implementación en sí de esas funciones es trivial. Lo que interesa ahora es la sintaxis (su significado), la manera en que se nos ofrecen los datos y cómo devolver nuestros resultados. El siguiente código utiliza la primera definición de XDR (sin operandos definidos)/p>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>12345678910111213141516171819/pre>/td>td classcode>pre classc stylefont-family:monospace;>span stylecolor: #339933;>#include <rpc/rpc.h>/span>span stylecolor: #339933;>#include "time.h"/span> span stylecolor: #993333;>char/span> span stylecolor: #339933;>**/span>hora_1_svcspan stylecolor: #009900;>(/span>span stylecolor: #993333;>struct/span> svc_req span stylecolor: #339933;>*/span>rqstpspan stylecolor: #009900;>)/span> span stylecolor: #009900;>{/span> span stylecolor: #993333;>static/span> span stylecolor: #993333;>long/span> timevalspan stylecolor: #339933;>;/span> span stylecolor: #666666; font-style: italic;>// debe ser una variable estática/span> span stylecolor: #993333;>static/span> span stylecolor: #993333;>char/span> span stylecolor: #339933;>*/span>ptrspan stylecolor: #339933;>;/span> span stylecolor: #666666; font-style: italic;>// debe ser una variable estática/span> timeval span stylecolor: #339933;>/span> span stylecolor: #000066;>time/span>span stylecolor: #009900;>(/span>span stylecolor: #009900;>(/span>span stylecolor: #993333;>long/span> span stylecolor: #339933;>*/span>span stylecolor: #009900;>)/span> span stylecolor: #0000dd;>0/span>span stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span> ptr span stylecolor: #339933;>/span> span stylecolor: #000066;>ctime/span>span stylecolor: #009900;>(/span>span stylecolor: #339933;>&/span>timevalspan stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span> span stylecolor: #b1b100;>return/span>span stylecolor: #009900;>(/span>span stylecolor: #339933;>&/span>ptrspan stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span>span stylecolor: #009900;>}/span> span stylecolor: #993333;>int/span> hora_prog_1_freeresultspan stylecolor: #009900;>(/span>SVCXPRT span stylecolor: #339933;>*/span>transpspan stylecolor: #339933;>,/span> xdrproc_t xdr_resultspan stylecolor: #339933;>,/span> caddr_t resultspan stylecolor: #009900;>)/span> span stylecolor: #009900;>{/span> xdr_freespan stylecolor: #009900;>(/span>xdr_resultspan stylecolor: #339933;>,/span> resultspan stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span> span stylecolor: #b1b100;>return/span> span stylecolor: #009900;>(/span>span stylecolor: #0000dd;>1/span>span stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span>span stylecolor: #009900;>}/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>#include <rpc/rpc.h>#include "time.h"char **hora_1_svc(struct svc_req *rqstp) { static long timeval; // debe ser una variable estática static char *ptr; // debe ser una variable estática timeval time((long *) 0); ptr ctime(&timeval); return(&ptr);}int hora_prog_1_freeresult(SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) { xdr_free(xdr_result, result); return (1);}/p>/div>p styletext-align: justify;>El tipo de retorno es un puntero al tipo que habíamos definido en el XDR (notar que stringchar*). Además, a la hora de devolver, devolvemos referencias a datos estáticos (ya que si devolviésemos referencias a la pila éstas no serían válidas al salir de la función). Este comportamiento es configurable en las opciones de rpcgen./p>p styletext-align: justify;>El tipo de los argumentos pueden ser también punteros a los tipos originales (Operandos) (no hay en el código de arriba), y además se añade un nuevo parámetro que es siempre struct svc_req*. El motivo de lo primero tiene que ver con cómo nos llegan los datos remotos (y con cómo los podemos modificar). El segundo parámetro contiene información sobre la petición que nos han hecho y el cliente que la ha realizado./p>p styletext-align: justify;>Con respecto al nombre de las funciones, estas se corresponden con el nombre descrito en el fichero XDR, añadiendo _i_svc, donde i es el número de versión que estamos implementando. Esto es así porque podemos tener diferentes versiones de una misma función, y con este sistema evitamos colisiones en los nombres./p>h2 styletext-align: justify;>Implementación del cliente/h2>p styletext-align: justify;>Para completar la parte de implementación, tenemos que escribir un código de cliente que haga uso de los procedimientos remotos. Éste se escribe como un programa local normal, salvo por que hacemos llamadas a ciertas funciones que son las que se encargan de hacer el trabajo de RPC./p>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>123456789101112131415161718192021222324252627/pre>/td>td classcode>pre classc stylefont-family:monospace;>span stylecolor: #339933;>#include <rpc/rpc.h>/span>span stylecolor: #339933;>#include <stdio.h>/span>span stylecolor: #339933;>#include "hora.h"/span> span stylecolor: #993333;>int/span> mainspan stylecolor: #009900;>(/span>span stylecolor: #993333;>int/span> argcspan stylecolor: #339933;>,/span> span stylecolor: #993333;>char/span> span stylecolor: #339933;>*/span>argvspan stylecolor: #009900;>[/span>span stylecolor: #009900;>]/span>span stylecolor: #009900;>)/span>span stylecolor: #009900;>{/span> CLIENT span stylecolor: #339933;>*/span>clspan stylecolor: #339933;>;/span> span stylecolor: #993333;>char/span> span stylecolor: #339933;>*/span>nombre_servidorspan stylecolor: #339933;>;/span> span stylecolor: #993333;>char/span> span stylecolor: #339933;>**/span>horaspan stylecolor: #339933;>;/span> span stylecolor: #b1b100;>if/span>span stylecolor: #009900;>(/span>argc span stylecolor: #339933;></span> span stylecolor: #0000dd;>2/span>span stylecolor: #009900;>)/span>span stylecolor: #009900;>{/span> span stylecolor: #000066;>perror/span>span stylecolor: #009900;>(/span>span stylecolor: #ff0000;>"Uso: ./client nombreservidor"/span>span stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span> span stylecolor: #009900;>}/span> nombre_servidor span stylecolor: #339933;>/span> argvspan stylecolor: #009900;>[/span>span stylecolor: #0000dd;>1/span>span stylecolor: #009900;>]/span>span stylecolor: #339933;>;/span> cl span stylecolor: #339933;>/span> clnt_createspan stylecolor: #009900;>(/span>nombre_servidorspan stylecolor: #339933;>,/span> HORA_PROGspan stylecolor: #339933;>,/span> HORA_VERSspan stylecolor: #339933;>,/span> span stylecolor: #ff0000;>"tcp"/span>span stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span> span stylecolor: #b1b100;>if/span>span stylecolor: #009900;>(/span>span stylecolor: #009900;>(/span>hora span stylecolor: #339933;>/span> hora_1span stylecolor: #009900;>(/span>NULLspan stylecolor: #339933;>,/span> clspan stylecolor: #009900;>)/span>span stylecolor: #009900;>)/span> span stylecolor: #339933;>/span> NULLspan stylecolor: #009900;>)/span> span stylecolor: #009900;>{/span> clnt_sperrorspan stylecolor: #009900;>(/span>clspan stylecolor: #339933;>,/span> argvspan stylecolor: #009900;>[/span>span stylecolor: #0000dd;>1/span>span stylecolor: #009900;>]/span>span stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span> span stylecolor: #009900;>}/span> span stylecolor: #000066;>printf/span>span stylecolor: #009900;>(/span>span stylecolor: #ff0000;>"span stylecolor: #000099; font-weight: bold;>\n/span>La hora del servidor %s es %s"/span>span stylecolor: #339933;>,/span> nombre_servidorspan stylecolor: #339933;>,/span> span stylecolor: #339933;>*/span>horaspan stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span> clnt_destroyspan stylecolor: #009900;>(/span>clspan stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span> span stylecolor: #000066;>exit/span>span stylecolor: #009900;>(/span>span stylecolor: #0000dd;>0/span>span stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span>span stylecolor: #009900;>}/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>#include <rpc/rpc.h>#include <stdio.h>#include "hora.h"int main(int argc, char *argv){ CLIENT *cl; char *nombre_servidor; char **hora; if(argc < 2){ perror("Uso: ./client nombreservidor"); } nombre_servidor argv1; cl clnt_create(nombre_servidor, HORA_PROG, HORA_VERS, "tcp"); if((hora hora_1(NULL, cl)) NULL) { clnt_sperror(cl, argv1); } printf("\nLa hora del servidor %s es %s", nombre_servidor, *hora); clnt_destroy(cl); exit(0);}/p>/div>p>El #include se hace sobre un fichero que todavía no hemos creado, hora.h. Éste se genera automáticamente con el comando rpcgen, y suele ser el nombre del fichero .x intercambiando la extensión./p>p>La instanciación se hace con la sentencia/p>div classwp_syntax styleposition:relative;>table>tr>td classline_numbers>pre>1/pre>/td>td classcode>pre classc stylefont-family:monospace;>cl span stylecolor: #339933;>/span> clnt_createspan stylecolor: #009900;>(/span>nombre_servidorspan stylecolor: #339933;>,/span> HORA_PROGspan stylecolor: #339933;>,/span> HORA_VERSspan stylecolor: #339933;>,/span> span stylecolor: #ff0000;>"tcp"/span>span stylecolor: #009900;>)/span>span stylecolor: #339933;>;/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>cl clnt_create(nombre_servidor, HORA_PROG, HORA_VERS, "tcp");/p>/div>p styletext-align: justify;>Esta llamada devuelve un stub, que es una estructura con toda la información que necesita nuestra biblioteca de rpc. Los parámetros que admiten son el nombre de host del servidor (localhost si hacéis las pruebas en modo local, o una ip, y dos constantes que básicamente tienen que ser el nombre que pusimos después de program y después de version en el fichero .x del principio. El último parámetro indica el protocolo de transporte que queremos usar para nuestra petición./p>p styletext-align: justify;>Las llamadas en sí son muy sencillas, y utilizan exactamente el mismo interfaz que implementamos en el servidor. El segundo parámetro es el stub del cliente. Como esta función no tiene parámetros, se introduce NULL./p>h2>/h2>h2>Compilación/h2>p>rpcgen es un programa que toma como argumentos un fichero .x y genera el código de los stubs./p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #666666;>$ /span>rpcgen hora.x/pre>/td>/tr>/table>p classtheCode styledisplay:none;>$ rpcgen hora.x/p>/div>p>Esta línea ha debido generar los siguientes ficheros: hora.h, hora_svc.c, hora_clnt.c y hora_xdr.c (en el caso de haber definido una estructura de operandos en el XDR)./p>p styletext-align: justify;>El primero, hora.h, están las definiciones de tipos, constantes y funciones generales comunes tanto al servidor como al cliente. Es por eso por lo que hemos hecho el include en nuestras implementaciones./p>p styletext-align: justify;>Los ficheros hora_clnt.c y hora_svc.c contienen respectivamente el código los stubs de cliente y de servidor. Dichos stubs son los que se encargan efectivamente de que la comunicación sea transparente: transforman los argumentos y retornos que usamos en las funciones publicadas como servicios y también las decodifican en el otro extremo./p>p styletext-align: justify;>hora_xdr.c es el módulo que contiene información sobre los tipos que ha definido el usuario. Como sólo hemos utilizado tipos básicos, no ha hecho falta./p>p styletext-align: justify;>Lo único que falta es compilar el programa cliente y el servidor como si de cualquier otro programa se tratase. Para el cliente, como hemos hecho una implementación en C, usamos gcc como compilador:/p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #666666;>$ /span>span stylecolor: #c20cb9; font-weight: bold;>gcc/span> client.c hora_clnt.c span stylecolor: #660033;>-o/span> client/pre>/td>/tr>/table>p classtheCode styledisplay:none;>$ gcc client.c hora_clnt.c -o client/p>/div>p>Para el servidor:/p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #666666;>$ /span>span stylecolor: #c20cb9; font-weight: bold;>gcc/span> server.c hora_svc.c span stylecolor: #660033;>-o/span> server/pre>/td>/tr>/table>p classtheCode styledisplay:none;>$ gcc server.c hora_svc.c -o server/p>/div>h2>Ejecución/h2>p>Si todo lo anterior ha ido bien, basta con ejecutar el servidor:/p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #666666;>$ /span>.span stylecolor: #000000; font-weight: bold;>//span>server/pre>/td>/tr>/table>p classtheCode styledisplay:none;>$ ./server/p>/div>p>y ejecutar el cliente:/p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>$ .span stylecolor: #000000; font-weight: bold;>//span>client localhostLa hora del servidor localhost es Thu Jul span stylecolor: #000000;>21/span> span stylecolor: #000000;>17/span>:span stylecolor: #000000;>31/span>:span stylecolor: #000000;>56/span> span stylecolor: #000000;>2011/span>/pre>/td>/tr>/table>p classtheCode styledisplay:none;>$ ./client localhostLa hora del servidor localhost es Thu Jul 21 17:31:56 2011/p>/div>p> /p>h2>Nota/h2>p>En recientes versiones de Ubuntu, tras ejecutar el servidor se obtiene un mensaje como este:/p>p>Cannot register service: RPC: Unable to receive; errno Connection refusedbr />unable to register (HORA_PROG, HORA_VERS, udp)./p>p>Esto es porque es necesario instalar el paquete portmap, lo cual puede realizarse con el siguiente comando en consola:/p>div classwp_syntax styleposition:relative;>table>tr>td classcode>pre classbash stylefont-family:monospace;>span stylecolor: #c20cb9; font-weight: bold;>sudo/span> span stylecolor: #c20cb9; font-weight: bold;>apt-get install/span> portmap/pre>/td>/tr>/table>p classtheCode styledisplay:none;>sudo apt-get install portmap/p>/div>p>Espero que el tema os haya gustado. Dejo abajo el enlace al código del ejemplo./p>figure idattachment_156 aria-describedbycaption-attachment-156 stylewidth: 46px classwp-caption alignleft>a hrefhttp://davidlopez.es/wp-content/uploads/2016/04/rpc_time.tar.gz>img loadinglazy classwp-image-156 size-full srchttps://davidlopez.es/wp-content/uploads/2016/04/archive.png altrpc_time.tar.gz width46 height60 />/a>figcaption idcaption-attachment-156 classwp-caption-text>code/figcaption>/figure> /div>!-- .entry-content --> /article>!-- #post-134 --> /main>!-- #main --> /div>!-- #primary --> aside idsecondary classwidget-area rolecomplementary aria-labelBarra lateral del blog> section idcategories-4 classwidget widget_categories>h2 classwidget-title>Categorías/h2>nav rolenavigation aria-labelCategorías> ul> li classcat-item cat-item-20>a hrefhttps://davidlopez.es/category/internet/>Internet/a>/li> li classcat-item cat-item-11>a hrefhttps://davidlopez.es/category/programacion/>Programación/a>/li> li classcat-item cat-item-1>a hrefhttps://davidlopez.es/category/sin-categoria/>Sin categoría/a>/li> li classcat-item cat-item-16>a hrefhttps://davidlopez.es/category/sistemas-operativos/>Sistemas operativos/a>/li> /ul> /nav>/section>section idtag_cloud-7 classwidget widget_tag_cloud>h2 classwidget-title>Etiquetas/h2>nav rolenavigation aria-labelEtiquetas>div classtagcloud>ul classwp-tag-cloud rolelist> li>a hrefhttps://davidlopez.es/tag/boot/ classtag-cloud-link tag-link-18 tag-link-position-1 stylefont-size: 1em;>boot/a>/li> li>a hrefhttps://davidlopez.es/tag/client/ classtag-cloud-link tag-link-15 tag-link-position-2 stylefont-size: 1em;>client/a>/li> li>a hrefhttps://davidlopez.es/tag/corba/ classtag-cloud-link tag-link-22 tag-link-position-3 stylefont-size: 1em;>CORBA/a>/li> li>a hrefhttps://davidlopez.es/tag/ftp/ classtag-cloud-link tag-link-21 tag-link-position-4 stylefont-size: 1em;>ftp/a>/li> li>a hrefhttps://davidlopez.es/tag/grub/ classtag-cloud-link tag-link-17 tag-link-position-5 stylefont-size: 1em;>grub/a>/li> li>a hrefhttps://davidlopez.es/tag/orb/ classtag-cloud-link tag-link-23 tag-link-position-6 stylefont-size: 1em;>ORB/a>/li> li>a hrefhttps://davidlopez.es/tag/rpc/ classtag-cloud-link tag-link-12 tag-link-position-7 stylefont-size: 1em;>rpc/a>/li> li>a hrefhttps://davidlopez.es/tag/server/ classtag-cloud-link tag-link-14 tag-link-position-8 stylefont-size: 1em;>server/a>/li> li>a hrefhttps://davidlopez.es/tag/sistemas-operativos/ classtag-cloud-link tag-link-19 tag-link-position-9 stylefont-size: 1em;>sistemas operativos/a>/li> li>a hrefhttps://davidlopez.es/tag/xdr/ classtag-cloud-link tag-link-13 tag-link-position-10 stylefont-size: 1em;>XDR/a>/li>/ul>/div>/nav>/section>section idtwitter-timeline-profile-2 classwidget widget_twitter-timeline-profile>h2 classwidget-title>Twitter DLopez_87/h2>div classtwitter-timeline-profile>a classtwitter-timeline data-langes hrefhttps://twitter.com/DLopez_87?ref_srctwsrc%5Etfw>Tweets by DLopez_87/a>/div>/section>/aside>!-- #secondary -->/div>!-- .wrap --> /div>!-- #content --> footer idcolophon classsite-footer rolecontentinfo> div classwrap> div classsite-info> a hrefhttps://es.wordpress.org/ classimprint> Funciona gracias a WordPress /a>/div>!-- .site-info --> /div>!-- .wrap --> /footer>!-- #colophon --> /div>!-- .site-content-contain -->/div>!-- #page -->link relstylesheet idsgmb_socialFont_style-css hrefhttps://davidlopez.es/wp-content/plugins/social-media-builder/css/jssocial/font-awesome.min.css?ver5.6.14 mediaall />link relstylesheet idsgmb_social2_style-css hrefhttps://davidlopez.es/wp-content/plugins/social-media-builder/css/jssocial/jssocials.css?ver5.6.14 mediaall />link relstylesheet idjssocials_theme_minima-css hrefhttps://davidlopez.es/wp-content/plugins/social-media-builder/css/jssocial/jssocials-theme-minima.css?ver5.6.14 mediaall />link relstylesheet idsgmb_widget_style-css hrefhttps://davidlopez.es/wp-content/plugins/social-media-builder/css/widget/widget-style.css?ver5.6.14 mediaall />link relstylesheet idsgmb_buttons_animate-css hrefhttps://davidlopez.es/wp-content/plugins/social-media-builder/css/animate.css?ver5.6.14 mediaall />link relstylesheet idsgmb_drop_down_style-css hrefhttps://davidlopez.es/wp-content/plugins/social-media-builder/css/widget/simple.dropdown.css?ver5.6.14 mediaall />script idcontact-form-7-js-extra>var wpcf7 {apiSettings:{root:https:\/\/davidlopez.es\/wp-json\/contact-form-7\/v1,namespace:contact-form-7\/v1}};/script>script srchttps://davidlopez.es/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver5.3.2 idcontact-form-7-js>/script>script srchttps://www.google.com/recaptcha/api.js?render6LfqfrgUAAAAAFOUHaSkZijWiYuafSgQjcIzWP8k&ver3.0 idgoogle-recaptcha-js>/script>script idwpcf7-recaptcha-js-extra>var wpcf7_recaptcha {sitekey:6LfqfrgUAAAAAFOUHaSkZijWiYuafSgQjcIzWP8k,actions:{homepage:homepage,contactform:contactform}};/script>script srchttps://davidlopez.es/wp-content/plugins/contact-form-7/modules/recaptcha/script.js?ver5.3.2 idwpcf7-recaptcha-js>/script>script srchttps://davidlopez.es/wp-content/plugins/wp-syntax/js/wp-syntax.js?ver1.1 idwp-syntax-js-js>/script>script idtwentyseventeen-skip-link-focus-fix-js-extra>var twentyseventeenScreenReaderText {quote:svg class\icon icon-quote-right\ aria-hidden\true\ role\img\> use href\#icon-quote-right\ xlink:href\#icon-quote-right\>\/use> \/svg>,expand:Expandir el men\u00fa inferior,collapse:Cerrar el men\u00fa inferior,icon:svg class\icon icon-angle-down\ aria-hidden\true\ role\img\> use href\#icon-angle-down\ xlink:href\#icon-angle-down\>\/use> span class\svg-fallback icon-angle-down\>\/span>\/svg>};/script>script srchttps://davidlopez.es/wp-content/themes/twentyseventeen/assets/js/skip-link-focus-fix.js?ver20161114 idtwentyseventeen-skip-link-focus-fix-js>/script>script srchttps://davidlopez.es/wp-content/themes/twentyseventeen/assets/js/navigation.js?ver20161203 idtwentyseventeen-navigation-js>/script>script srchttps://davidlopez.es/wp-content/themes/twentyseventeen/assets/js/global.js?ver20190121 idtwentyseventeen-global-js>/script>script srchttps://davidlopez.es/wp-content/themes/twentyseventeen/assets/js/jquery.scrollTo.js?ver2.1.2 idjquery-scrollto-js>/script>script idtwitter-wjs-js-extra>window.twttr(function(w){tw.twttr||{};t._e;t.readyfunction(f){t._e.push(f);};return t;}(window));/script>script typetext/javascript idtwitter-wjs async defer srchttps://platform.twitter.com/widgets.js charsetutf-8>/script>script srchttps://davidlopez.es/wp-includes/js/wp-embed.min.js?ver5.6.14 idwp-embed-js>/script>script srchttps://davidlopez.es/wp-content/plugins/social-media-builder/js/addNewSection/SGMB.js idsgmb-class-sgmb-js>/script>script srchttps://davidlopez.es/wp-content/plugins/social-media-builder/js/addNewSection/SGMBWidget.js idsgmb-class-sgmbWidget-js>/script>script srchttps://davidlopez.es/wp-content/plugins/social-media-builder/js/jssocials.js idsgmb-jssocial1-scripts-js>/script>script srchttps://davidlopez.es/wp-content/plugins/social-media-builder/js/jssocials.shares.js idsgmb-jssocial2-scripts-js>/script>script srchttps://davidlopez.es/wp-content/plugins/social-media-builder/js/simple.dropdown.js idsgmb-drop_down-scripts-js>/script>svg styleposition: absolute; width: 0; height: 0; overflow: hidden; version1.1 xmlnshttp://www.w3.org/2000/svg xmlns:xlinkhttp://www.w3.org/1999/xlink>defs>symbol idicon-behance viewBox0 0 37 32>path classpath1 dM33 6.054h-9.125v2.214h9.125v-2.214zM28.5 13.661q-1.607 0-2.607 0.938t-1.107 2.545h7.286q-0.321-3.482-3.571-3.482zM28.786 24.107q1.125 0 2.179-0.571t1.357-1.554h3.946q-1.786 5.482-7.625 5.482-3.821 0-6.080-2.357t-2.259-6.196q0-3.714 2.33-6.17t6.009-2.455q2.464 0 4.295 1.214t2.732 3.196 0.902 4.429q0 0.304-0.036 0.839h-11.75q0 1.982 1.027 3.063t2.973 1.080zM4.946 23.214h5.286q3.661 0 3.661-2.982 0-3.214-3.554-3.214h-5.393v6.196zM4.946 13.625h5.018q1.393 0 2.205-0.652t0.813-2.027q0-2.571-3.393-2.571h-4.643v5.25zM0 4.536h10.607q1.554 0 2.768 0.25t2.259 0.848 1.607 1.723 0.563 2.75q0 3.232-3.071 4.696 2.036 0.571 3.071 2.054t1.036 3.643q0 1.339-0.438 2.438t-1.179 1.848-1.759 1.268-2.161 0.75-2.393 0.232h-10.911v-22.5z>/path>/symbol>symbol idicon-deviantart viewBox0 0 18 32>path classpath1 dM18.286 5.411l-5.411 10.393 0.429 0.554h4.982v7.411h-9.054l-0.786 0.536-2.536 4.875-0.536 0.536h-5.375v-5.411l5.411-10.411-0.429-0.536h-4.982v-7.411h9.054l0.786-0.536 2.536-4.875 0.536-0.536h5.375v5.411z>/path>/symbol>symbol idicon-medium viewBox0 0 32 32>path classpath1 dM10.661 7.518v20.946q0 0.446-0.223 0.759t-0.652 0.313q-0.304 0-0.589-0.143l-8.304-4.161q-0.375-0.179-0.634-0.598t-0.259-0.83v-20.357q0-0.357 0.179-0.607t0.518-0.25q0.25 0 0.786 0.268l9.125 4.571q0.054 0.054 0.054 0.089zM11.804 9.321l9.536 15.464-9.536-4.75v-10.714zM32 9.643v18.821q0 0.446-0.25 0.723t-0.679 0.277-0.839-0.232l-7.875-3.929zM31.946 7.5q0 0.054-4.58 7.491t-5.366 8.705l-6.964-11.321 5.786-9.411q0.304-0.5 0.929-0.5 0.25 0 0.464 0.107l9.661 4.821q0.071 0.036 0.071 0.107z>/path>/symbol>symbol idicon-slideshare viewBox0 0 32 32>path classpath1 dM15.589 13.214q0 1.482-1.134 2.545t-2.723 1.063-2.723-1.063-1.134-2.545q0-1.5 1.134-2.554t2.723-1.054 2.723 1.054 1.134 2.554zM24.554 13.214q0 1.482-1.125 2.545t-2.732 1.063q-1.589 0-2.723-1.063t-1.134-2.545q0-1.5 1.134-2.554t2.723-1.054q1.607 0 2.732 1.054t1.125 2.554zM28.571 16.429v-11.911q0-1.554-0.571-2.205t-1.982-0.652h-19.857q-1.482 0-2.009 0.607t-0.527 2.25v12.018q0.768 0.411 1.58 0.714t1.446 0.5 1.446 0.33 1.268 0.196 1.25 0.071 1.045 0.009 1.009-0.036 0.795-0.036q1.214-0.018 1.696 0.482 0.107 0.107 0.179 0.161 0.464 0.446 1.089 0.911 0.125-1.625 2.107-1.554 0.089 0 0.652 0.027t0.768 0.036 0.813 0.018 0.946-0.018 0.973-0.080 1.089-0.152 1.107-0.241 1.196-0.348 1.205-0.482 1.286-0.616zM31.482 16.339q-2.161 2.661-6.643 4.5 1.5 5.089-0.411 8.304-1.179 2.018-3.268 2.643-1.857 0.571-3.25-0.268-1.536-0.911-1.464-2.929l-0.018-5.821v-0.018q-0.143-0.036-0.438-0.107t-0.42-0.089l-0.018 6.036q0.071 2.036-1.482 2.929-1.411 0.839-3.268 0.268-2.089-0.643-3.25-2.679-1.875-3.214-0.393-8.268-4.482-1.839-6.643-4.5-0.446-0.661-0.071-1.125t1.071 0.018q0.054 0.036 0.196 0.125t0.196 0.143v-12.393q0-1.286 0.839-2.196t2.036-0.911h22.446q1.196 0 2.036 0.911t0.839 2.196v12.393l0.375-0.268q0.696-0.482 1.071-0.018t-0.071 1.125z>/path>/symbol>symbol idicon-snapchat-ghost viewBox0 0 30 32>path classpath1 dM15.143 2.286q2.393-0.018 4.295 1.223t2.92 3.438q0.482 1.036 0.482 3.196 0 0.839-0.161 3.411 0.25 0.125 0.5 0.125 0.321 0 0.911-0.241t0.911-0.241q0.518 0 1 0.321t0.482 0.821q0 0.571-0.563 0.964t-1.232 0.563-1.232 0.518-0.563 0.848q0 0.268 0.214 0.768 0.661 1.464 1.83 2.679t2.58 1.804q0.5 0.214 1.429 0.411 0.5 0.107 0.5 0.625 0 1.25-3.911 1.839-0.125 0.196-0.196 0.696t-0.25 0.83-0.589 0.33q-0.357 0-1.107-0.116t-1.143-0.116q-0.661 0-1.107 0.089-0.571 0.089-1.125 0.402t-1.036 0.679-1.036 0.723-1.357 0.598-1.768 0.241q-0.929 0-1.723-0.241t-1.339-0.598-1.027-0.723-1.036-0.679-1.107-0.402q-0.464-0.089-1.125-0.089-0.429 0-1.17 0.134t-1.045 0.134q-0.446 0-0.625-0.33t-0.25-0.848-0.196-0.714q-3.911-0.589-3.911-1.839 0-0.518 0.5-0.625 0.929-0.196 1.429-0.411 1.393-0.571 2.58-1.804t1.83-2.679q0.214-0.5 0.214-0.768 0-0.5-0.563-0.848t-1.241-0.527-1.241-0.563-0.563-0.938q0-0.482 0.464-0.813t0.982-0.33q0.268 0 0.857 0.232t0.946 0.232q0.321 0 0.571-0.125-0.161-2.536-0.161-3.393 0-2.179 0.482-3.214 1.143-2.446 3.071-3.536t4.714-1.125z>/path>/symbol>symbol idicon-yelp viewBox0 0 27 32>path classpath1 dM13.804 23.554v2.268q-0.018 5.214-0.107 5.446-0.214 0.571-0.911 0.714-0.964 0.161-3.241-0.679t-2.902-1.589q-0.232-0.268-0.304-0.643-0.018-0.214 0.071-0.464 0.071-0.179 0.607-0.839t3.232-3.857q0.018 0 1.071-1.25 0.268-0.339 0.705-0.438t0.884 0.063q0.429 0.179 0.67 0.518t0.223 0.75zM11.143 19.071q-0.054 0.982-0.929 1.25l-2.143 0.696q-4.911 1.571-5.214 1.571-0.625-0.036-0.964-0.643-0.214-0.446-0.304-1.339-0.143-1.357 0.018-2.973t0.536-2.223 1-0.571q0.232 0 3.607 1.375 1.25 0.518 2.054 0.839l1.5 0.607q0.411 0.161 0.634 0.545t0.205 0.866zM25.893 24.375q-0.125 0.964-1.634 2.875t-2.42 2.268q-0.661 0.25-1.125-0.125-0.25-0.179-3.286-5.125l-0.839-1.375q-0.25-0.375-0.205-0.821t0.348-0.821q0.625-0.768 1.482-0.464 0.018 0.018 2.125 0.714 3.625 1.179 4.321 1.42t0.839 0.366q0.5 0.393 0.393 1.089zM13.893 13.089q0.089 1.821-0.964 2.179-1.036 0.304-2.036-1.268l-6.75-10.679q-0.143-0.625 0.339-1.107 0.732-0.768 3.705-1.598t4.009-0.563q0.714 0.179 0.875 0.804 0.054 0.321 0.393 5.455t0.429 6.777zM25.714 15.018q0.054 0.696-0.464 1.054-0.268 0.179-5.875 1.536-1.196 0.268-1.625 0.411l0.018-0.036q-0.411 0.107-0.821-0.071t-0.661-0.571q-0.536-0.839 0-1.554 0.018-0.018 1.339-1.821 2.232-3.054 2.679-3.643t0.607-0.696q0.5-0.339 1.161-0.036 0.857 0.411 2.196 2.384t1.446 2.991v0.054z>/path>/symbol>symbol idicon-vine viewBox0 0 27 32>path classpath1 dM26.732 14.768v3.536q-1.804 0.411-3.536 0.411-1.161 2.429-2.955 4.839t-3.241 3.848-2.286 1.902q-1.429 0.804-2.893-0.054-0.5-0.304-1.080-0.777t-1.518-1.491-1.83-2.295-1.92-3.286-1.884-4.357-1.634-5.616-1.259-6.964h5.054q0.464 3.893 1.25 7.116t1.866 5.661 2.17 4.205 2.5 3.482q3.018-3.018 5.125-7.25-2.536-1.286-3.982-3.929t-1.446-5.946q0-3.429 1.857-5.616t5.071-2.188q3.179 0 4.875 1.884t1.696 5.313q0 2.839-1.036 5.107-0.125 0.018-0.348 0.054t-0.821 0.036-1.125-0.107-1.107-0.455-0.902-0.92q0.554-1.839 0.554-3.286 0-1.554-0.518-2.357t-1.411-0.804q-0.946 0-1.518 0.884t-0.571 2.509q0 3.321 1.875 5.241t4.768 1.92q1.107 0 2.161-0.25z>/path>/symbol>symbol idicon-vk viewBox0 0 35 32>path classpath1 dM34.232 9.286q0.411 1.143-2.679 5.25-0.429 0.571-1.161 1.518-1.393 1.786-1.607 2.339-0.304 0.732 0.25 1.446 0.304 0.375 1.446 1.464h0.018l0.071 0.071q2.518 2.339 3.411 3.946 0.054 0.089 0.116 0.223t0.125 0.473-0.009 0.607-0.446 0.491-1.054 0.223l-4.571 0.071q-0.429 0.089-1-0.089t-0.929-0.393l-0.357-0.214q-0.536-0.375-1.25-1.143t-1.223-1.384-1.089-1.036-1.009-0.277q-0.054 0.018-0.143 0.063t-0.304 0.259-0.384 0.527-0.304 0.929-0.116 1.384q0 0.268-0.063 0.491t-0.134 0.33l-0.071 0.089q-0.321 0.339-0.946 0.393h-2.054q-1.268 0.071-2.607-0.295t-2.348-0.946-1.839-1.179-1.259-1.027l-0.446-0.429q-0.179-0.179-0.491-0.536t-1.277-1.625-1.893-2.696-2.188-3.768-2.33-4.857q-0.107-0.286-0.107-0.482t0.054-0.286l0.071-0.107q0.268-0.339 1.018-0.339l4.893-0.036q0.214 0.036 0.411 0.116t0.286 0.152l0.089 0.054q0.286 0.196 0.429 0.571 0.357 0.893 0.821 1.848t0.732 1.455l0.286 0.518q0.518 1.071 1 1.857t0.866 1.223 0.741 0.688 0.607 0.25 0.482-0.089q0.036-0.018 0.089-0.089t0.214-0.393 0.241-0.839 0.17-1.446 0-2.232q-0.036-0.714-0.161-1.304t-0.25-0.821l-0.107-0.214q-0.446-0.607-1.518-0.768-0.232-0.036 0.089-0.429 0.304-0.339 0.679-0.536 0.946-0.464 4.268-0.429 1.464 0.018 2.411 0.232 0.357 0.089 0.598 0.241t0.366 0.429 0.188 0.571 0.063 0.813-0.018 0.982-0.045 1.259-0.027 1.473q0 0.196-0.018 0.75t-0.009 0.857 0.063 0.723 0.205 0.696 0.402 0.438q0.143 0.036 0.304 0.071t0.464-0.196 0.679-0.616 0.929-1.196 1.214-1.92q1.071-1.857 1.911-4.018 0.071-0.179 0.179-0.313t0.196-0.188l0.071-0.054 0.089-0.045t0.232-0.054 0.357-0.009l5.143-0.036q0.696-0.089 1.143 0.045t0.554 0.295z>/path>/symbol>symbol idicon-search viewBox0 0 30 32>path classpath1 dM20.571 14.857q0-3.304-2.348-5.652t-5.652-2.348-5.652 2.348-2.348 5.652 2.348 5.652 5.652 2.348 5.652-2.348 2.348-5.652zM29.714 29.714q0 0.929-0.679 1.607t-1.607 0.679q-0.964 0-1.607-0.679l-6.125-6.107q-3.196 2.214-7.125 2.214-2.554 0-4.884-0.991t-4.018-2.679-2.679-4.018-0.991-4.884 0.991-4.884 2.679-4.018 4.018-2.679 4.884-0.991 4.884 0.991 4.018 2.679 2.679 4.018 0.991 4.884q0 3.929-2.214 7.125l6.125 6.125q0.661 0.661 0.661 1.607z>/path>/symbol>symbol idicon-envelope-o viewBox0 0 32 32>path classpath1 dM29.714 26.857v-13.714q-0.571 0.643-1.232 1.179-4.786 3.679-7.607 6.036-0.911 0.768-1.482 1.196t-1.545 0.866-1.83 0.438h-0.036q-0.857 0-1.83-0.438t-1.545-0.866-1.482-1.196q-2.821-2.357-7.607-6.036-0.661-0.536-1.232-1.179v13.714q0 0.232 0.17 0.402t0.402 0.17h26.286q0.232 0 0.402-0.17t0.17-0.402zM29.714 8.089v-0.438t-0.009-0.232-0.054-0.223-0.098-0.161-0.161-0.134-0.25-0.045h-26.286q-0.232 0-0.402 0.17t-0.17 0.402q0 3 2.625 5.071 3.446 2.714 7.161 5.661 0.107 0.089 0.625 0.527t0.821 0.67 0.795 0.563 0.902 0.491 0.768 0.161h0.036q0.357 0 0.768-0.161t0.902-0.491 0.795-0.563 0.821-0.67 0.625-0.527q3.714-2.946 7.161-5.661 0.964-0.768 1.795-2.063t0.83-2.348zM32 7.429v19.429q0 1.179-0.839 2.018t-2.018 0.839h-26.286q-1.179 0-2.018-0.839t-0.839-2.018v-19.429q0-1.179 0.839-2.018t2.018-0.839h26.286q1.179 0 2.018 0.839t0.839 2.018z>/path>/symbol>symbol idicon-close viewBox0 0 25 32>path classpath1 dM23.179 23.607q0 0.714-0.5 1.214l-2.429 2.429q-0.5 0.5-1.214 0.5t-1.214-0.5l-5.25-5.25-5.25 5.25q-0.5 0.5-1.214 0.5t-1.214-0.5l-2.429-2.429q-0.5-0.5-0.5-1.214t0.5-1.214l5.25-5.25-5.25-5.25q-0.5-0.5-0.5-1.214t0.5-1.214l2.429-2.429q0.5-0.5 1.214-0.5t1.214 0.5l5.25 5.25 5.25-5.25q0.5-0.5 1.214-0.5t1.214 0.5l2.429 2.429q0.5 0.5 0.5 1.214t-0.5 1.214l-5.25 5.25 5.25 5.25q0.5 0.5 0.5 1.214z>/path>/symbol>symbol idicon-angle-down viewBox0 0 21 32>path classpath1 dM19.196 13.143q0 0.232-0.179 0.411l-8.321 8.321q-0.179 0.179-0.411 0.179t-0.411-0.179l-8.321-8.321q-0.179-0.179-0.179-0.411t0.179-0.411l0.893-0.893q0.179-0.179 0.411-0.179t0.411 0.179l7.018 7.018 7.018-7.018q0.179-0.179 0.411-0.179t0.411 0.179l0.893 0.893q0.179 0.179 0.179 0.411z>/path>/symbol>symbol idicon-folder-open viewBox0 0 34 32>path classpath1 dM33.554 17q0 0.554-0.554 1.179l-6 7.071q-0.768 0.911-2.152 1.545t-2.563 0.634h-19.429q-0.607 0-1.080-0.232t-0.473-0.768q0-0.554 0.554-1.179l6-7.071q0.768-0.911 2.152-1.545t2.563-0.634h19.429q0.607 0 1.080 0.232t0.473 0.768zM27.429 10.857v2.857h-14.857q-1.679 0-3.518 0.848t-2.929 2.134l-6.107 7.179q0-0.071-0.009-0.223t-0.009-0.223v-17.143q0-1.643 1.179-2.821t2.821-1.179h5.714q1.643 0 2.821 1.179t1.179 2.821v0.571h9.714q1.643 0 2.821 1.179t1.179 2.821z>/path>/symbol>symbol idicon-twitter viewBox0 0 30 32>path classpath1 dM28.929 7.286q-1.196 1.75-2.893 2.982 0.018 0.25 0.018 0.75 0 2.321-0.679 4.634t-2.063 4.437-3.295 3.759-4.607 2.607-5.768 0.973q-4.839 0-8.857-2.589 0.625 0.071 1.393 0.071 4.018 0 7.161-2.464-1.875-0.036-3.357-1.152t-2.036-2.848q0.589 0.089 1.089 0.089 0.768 0 1.518-0.196-2-0.411-3.313-1.991t-1.313-3.67v-0.071q1.214 0.679 2.607 0.732-1.179-0.786-1.875-2.054t-0.696-2.75q0-1.571 0.786-2.911 2.161 2.661 5.259 4.259t6.634 1.777q-0.143-0.679-0.143-1.321 0-2.393 1.688-4.080t4.080-1.688q2.5 0 4.214 1.821 1.946-0.375 3.661-1.393-0.661 2.054-2.536 3.179 1.661-0.179 3.321-0.893z>/path>/symbol>symbol idicon-facebook viewBox0 0 19 32>path classpath1 dM17.125 0.214v4.714h-2.804q-1.536 0-2.071 0.643t-0.536 1.929v3.375h5.232l-0.696 5.286h-4.536v13.554h-5.464v-13.554h-4.554v-5.286h4.554v-3.893q0-3.321 1.857-5.152t4.946-1.83q2.625 0 4.071 0.214z>/path>/symbol>symbol idicon-github viewBox0 0 27 32>path classpath1 dM13.714 2.286q3.732 0 6.884 1.839t4.991 4.991 1.839 6.884q0 4.482-2.616 8.063t-6.759 4.955q-0.482 0.089-0.714-0.125t-0.232-0.536q0-0.054 0.009-1.366t0.009-2.402q0-1.732-0.929-2.536 1.018-0.107 1.83-0.321t1.679-0.696 1.446-1.188 0.946-1.875 0.366-2.688q0-2.125-1.411-3.679 0.661-1.625-0.143-3.643-0.5-0.161-1.446 0.196t-1.643 0.786l-0.679 0.429q-1.661-0.464-3.429-0.464t-3.429 0.464q-0.286-0.196-0.759-0.482t-1.491-0.688-1.518-0.241q-0.804 2.018-0.143 3.643-1.411 1.554-1.411 3.679 0 1.518 0.366 2.679t0.938 1.875 1.438 1.196 1.679 0.696 1.83 0.321q-0.696 0.643-0.875 1.839-0.375 0.179-0.804 0.268t-1.018 0.089-1.17-0.384-0.991-1.116q-0.339-0.571-0.866-0.929t-0.884-0.429l-0.357-0.054q-0.375 0-0.518 0.080t-0.089 0.205 0.161 0.25 0.232 0.214l0.125 0.089q0.393 0.179 0.777 0.679t0.563 0.911l0.179 0.411q0.232 0.679 0.786 1.098t1.196 0.536 1.241 0.125 0.991-0.063l0.411-0.071q0 0.679 0.009 1.58t0.009 0.973q0 0.321-0.232 0.536t-0.714 0.125q-4.143-1.375-6.759-4.955t-2.616-8.063q0-3.732 1.839-6.884t4.991-4.991 6.884-1.839zM5.196 21.982q0.054-0.125-0.125-0.214-0.179-0.054-0.232 0.036-0.054 0.125 0.125 0.214 0.161 0.107 0.232-0.036zM5.75 22.589q0.125-0.089-0.036-0.286-0.179-0.161-0.286-0.054-0.125 0.089 0.036 0.286 0.179 0.179 0.286 0.054zM6.286 23.393q0.161-0.125 0-0.339-0.143-0.232-0.304-0.107-0.161 0.089 0 0.321t0.304 0.125zM7.036 24.143q0.143-0.143-0.071-0.339-0.214-0.214-0.357-0.054-0.161 0.143 0.071 0.339 0.214 0.214 0.357 0.054zM8.054 24.589q0.054-0.196-0.232-0.286-0.268-0.071-0.339 0.125t0.232 0.268q0.268 0.107 0.339-0.107zM9.179 24.679q0-0.232-0.304-0.196-0.286 0-0.286 0.196 0 0.232 0.304 0.196 0.286 0 0.286-0.196zM10.214 24.5q-0.036-0.196-0.321-0.161-0.286 0.054-0.25 0.268t0.321 0.143 0.25-0.25z>/path>/symbol>symbol idicon-bars viewBox0 0 27 32>path classpath1 dM27.429 24v2.286q0 0.464-0.339 0.804t-0.804 0.339h-25.143q-0.464 0-0.804-0.339t-0.339-0.804v-2.286q0-0.464 0.339-0.804t0.804-0.339h25.143q0.464 0 0.804 0.339t0.339 0.804zM27.429 14.857v2.286q0 0.464-0.339 0.804t-0.804 0.339h-25.143q-0.464 0-0.804-0.339t-0.339-0.804v-2.286q0-0.464 0.339-0.804t0.804-0.339h25.143q0.464 0 0.804 0.339t0.339 0.804zM27.429 5.714v2.286q0 0.464-0.339 0.804t-0.804 0.339h-25.143q-0.464 0-0.804-0.339t-0.339-0.804v-2.286q0-0.464 0.339-0.804t0.804-0.339h25.143q0.464 0 0.804 0.339t0.339 0.804z>/path>/symbol>symbol idicon-google-plus viewBox0 0 41 32>path classpath1 dM25.661 16.304q0 3.714-1.554 6.616t-4.429 4.536-6.589 1.634q-2.661 0-5.089-1.036t-4.179-2.786-2.786-4.179-1.036-5.089 1.036-5.089 2.786-4.179 4.179-2.786 5.089-1.036q5.107 0 8.768 3.429l-3.554 3.411q-2.089-2.018-5.214-2.018-2.196 0-4.063 1.107t-2.955 3.009-1.089 4.152 1.089 4.152 2.955 3.009 4.063 1.107q1.482 0 2.723-0.411t2.045-1.027 1.402-1.402 0.875-1.482 0.384-1.321h-7.429v-4.5h12.357q0.214 1.125 0.214 2.179zM41.143 14.125v3.75h-3.732v3.732h-3.75v-3.732h-3.732v-3.75h3.732v-3.732h3.75v3.732h3.732z>/path>/symbol>symbol idicon-linkedin viewBox0 0 27 32>path classpath1 dM6.232 11.161v17.696h-5.893v-17.696h5.893zM6.607 5.696q0.018 1.304-0.902 2.179t-2.42 0.875h-0.036q-1.464 0-2.357-0.875t-0.893-2.179q0-1.321 0.92-2.188t2.402-0.866 2.375 0.866 0.911 2.188zM27.429 18.714v10.143h-5.875v-9.464q0-1.875-0.723-2.938t-2.259-1.063q-1.125 0-1.884 0.616t-1.134 1.527q-0.196 0.536-0.196 1.446v9.875h-5.875q0.036-7.125 0.036-11.554t-0.018-5.286l-0.018-0.857h5.875v2.571h-0.036q0.357-0.571 0.732-1t1.009-0.929 1.554-0.777 2.045-0.277q3.054 0 4.911 2.027t1.857 5.938z>/path>/symbol>symbol idicon-quote-right viewBox0 0 30 32>path classpath1 dM13.714 5.714v12.571q0 1.857-0.723 3.545t-1.955 2.92-2.92 1.955-3.545 0.723h-1.143q-0.464 0-0.804-0.339t-0.339-0.804v-2.286q0-0.464 0.339-0.804t0.804-0.339h1.143q1.893 0 3.232-1.339t1.339-3.232v-0.571q0-0.714-0.5-1.214t-1.214-0.5h-4q-1.429 0-2.429-1t-1-2.429v-6.857q0-1.429 1-2.429t2.429-1h6.857q1.429 0 2.429 1t1 2.429zM29.714 5.714v12.571q0 1.857-0.723 3.545t-1.955 2.92-2.92 1.955-3.545 0.723h-1.143q-0.464 0-0.804-0.339t-0.339-0.804v-2.286q0-0.464 0.339-0.804t0.804-0.339h1.143q1.893 0 3.232-1.339t1.339-3.232v-0.571q0-0.714-0.5-1.214t-1.214-0.5h-4q-1.429 0-2.429-1t-1-2.429v-6.857q0-1.429 1-2.429t2.429-1h6.857q1.429 0 2.429 1t1 2.429z>/path>/symbol>symbol idicon-mail-reply viewBox0 0 32 32>path classpath1 dM32 20q0 2.964-2.268 8.054-0.054 0.125-0.188 0.429t-0.241 0.536-0.232 0.393q-0.214 0.304-0.5 0.304-0.268 0-0.42-0.179t-0.152-0.446q0-0.161 0.045-0.473t0.045-0.42q0.089-1.214 0.089-2.196 0-1.804-0.313-3.232t-0.866-2.473-1.429-1.804-1.884-1.241-2.375-0.759-2.75-0.384-3.134-0.107h-4v4.571q0 0.464-0.339 0.804t-0.804 0.339-0.804-0.339l-9.143-9.143q-0.339-0.339-0.339-0.804t0.339-0.804l9.143-9.143q0.339-0.339 0.804-0.339t0.804 0.339 0.339 0.804v4.571h4q12.732 0 15.625 7.196 0.946 2.393 0.946 5.946z>/path>/symbol>symbol idicon-youtube viewBox0 0 27 32>path classpath1 dM17.339 22.214v3.768q0 1.196-0.696 1.196-0.411 0-0.804-0.393v-5.375q0.393-0.393 0.804-0.393 0.696 0 0.696 1.196zM23.375 22.232v0.821h-1.607v-0.821q0-1.214 0.804-1.214t0.804 1.214zM6.125 18.339h1.911v-1.679h-5.571v1.679h1.875v10.161h1.786v-10.161zM11.268 28.5h1.589v-8.821h-1.589v6.75q-0.536 0.75-1.018 0.75-0.321 0-0.375-0.375-0.018-0.054-0.018-0.625v-6.5h-1.589v6.982q0 0.875 0.143 1.304 0.214 0.661 1.036 0.661 0.857 0 1.821-1.089v0.964zM18.929 25.857v-3.518q0-1.304-0.161-1.768-0.304-1-1.268-1-0.893 0-1.661 0.964v-3.875h-1.589v11.839h1.589v-0.857q0.804 0.982 1.661 0.982 0.964 0 1.268-0.982 0.161-0.482 0.161-1.786zM24.964 25.679v-0.232h-1.625q0 0.911-0.036 1.089-0.125 0.643-0.714 0.643-0.821 0-0.821-1.232v-1.554h3.196v-1.839q0-1.411-0.482-2.071-0.696-0.911-1.893-0.911-1.214 0-1.911 0.911-0.5 0.661-0.5 2.071v3.089q0 1.411 0.518 2.071 0.696 0.911 1.929 0.911 1.286 0 1.929-0.946 0.321-0.482 0.375-0.964 0.036-0.161 0.036-1.036zM14.107 9.375v-3.75q0-1.232-0.768-1.232t-0.768 1.232v3.75q0 1.25 0.768 1.25t0.768-1.25zM26.946 22.786q0 4.179-0.464 6.25-0.25 1.054-1.036 1.768t-1.821 0.821q-3.286 0.375-9.911 0.375t-9.911-0.375q-1.036-0.107-1.83-0.821t-1.027-1.768q-0.464-2-0.464-6.25 0-4.179 0.464-6.25 0.25-1.054 1.036-1.768t1.839-0.839q3.268-0.357 9.893-0.357t9.911 0.357q1.036 0.125 1.83 0.839t1.027 1.768q0.464 2 0.464 6.25zM9.125 0h1.821l-2.161 7.125v4.839h-1.786v-4.839q-0.25-1.321-1.089-3.786-0.661-1.839-1.161-3.339h1.893l1.268 4.696zM15.732 5.946v3.125q0 1.446-0.5 2.107-0.661 0.911-1.893 0.911-1.196 0-1.875-0.911-0.5-0.679-0.5-2.107v-3.125q0-1.429 0.5-2.089 0.679-0.911 1.875-0.911 1.232 0 1.893 0.911 0.5 0.661 0.5 2.089zM21.714 3.054v8.911h-1.625v-0.982q-0.946 1.107-1.839 1.107-0.821 0-1.054-0.661-0.143-0.429-0.143-1.339v-7.036h1.625v6.554q0 0.589 0.018 0.625 0.054 0.393 0.375 0.393 0.482 0 1.018-0.768v-6.804h1.625z>/path>/symbol>symbol idicon-dropbox viewBox0 0 32 32>path classpath1 dM7.179 12.625l8.821 5.446-6.107 5.089-8.75-5.696zM24.786 22.536v1.929l-8.75 5.232v0.018l-0.018-0.018-0.018 0.018v-0.018l-8.732-5.232v-1.929l2.625 1.714 6.107-5.071v-0.036l0.018 0.018 0.018-0.018v0.036l6.125 5.071zM9.893 2.107l6.107 5.089-8.821 5.429-6.036-4.821zM24.821 12.625l6.036 4.839-8.732 5.696-6.125-5.089zM22.125 2.107l8.732 5.696-6.036 4.821-8.821-5.429z>/path>/symbol>symbol idicon-instagram viewBox0 0 27 32>path classpath1 dM18.286 16q0-1.893-1.339-3.232t-3.232-1.339-3.232 1.339-1.339 3.232 1.339 3.232 3.232 1.339 3.232-1.339 1.339-3.232zM20.75 16q0 2.929-2.054 4.982t-4.982 2.054-4.982-2.054-2.054-4.982 2.054-4.982 4.982-2.054 4.982 2.054 2.054 4.982zM22.679 8.679q0 0.679-0.482 1.161t-1.161 0.482-1.161-0.482-0.482-1.161 0.482-1.161 1.161-0.482 1.161 0.482 0.482 1.161zM13.714 4.75q-0.125 0-1.366-0.009t-1.884 0-1.723 0.054-1.839 0.179-1.277 0.33q-0.893 0.357-1.571 1.036t-1.036 1.571q-0.196 0.518-0.33 1.277t-0.179 1.839-0.054 1.723 0 1.884 0.009 1.366-0.009 1.366 0 1.884 0.054 1.723 0.179 1.839 0.33 1.277q0.357 0.893 1.036 1.571t1.571 1.036q0.518 0.196 1.277 0.33t1.839 0.179 1.723 0.054 1.884 0 1.366-0.009 1.366 0.009 1.884 0 1.723-0.054 1.839-0.179 1.277-0.33q0.893-0.357 1.571-1.036t1.036-1.571q0.196-0.518 0.33-1.277t0.179-1.839 0.054-1.723 0-1.884-0.009-1.366 0.009-1.366 0-1.884-0.054-1.723-0.179-1.839-0.33-1.277q-0.357-0.893-1.036-1.571t-1.571-1.036q-0.518-0.196-1.277-0.33t-1.839-0.179-1.723-0.054-1.884 0-1.366 0.009zM27.429 16q0 4.089-0.089 5.661-0.179 3.714-2.214 5.75t-5.75 2.214q-1.571 0.089-5.661 0.089t-5.661-0.089q-3.714-0.179-5.75-2.214t-2.214-5.75q-0.089-1.571-0.089-5.661t0.089-5.661q0.179-3.714 2.214-5.75t5.75-2.214q1.571-0.089 5.661-0.089t5.661 0.089q3.714 0.179 5.75 2.214t2.214 5.75q0.089 1.571 0.089 5.661z>/path>/symbol>symbol idicon-flickr viewBox0 0 27 32>path classpath1 dM22.286 2.286q2.125 0 3.634 1.509t1.509 3.634v17.143q0 2.125-1.509 3.634t-3.634 1.509h-17.143q-2.125 0-3.634-1.509t-1.509-3.634v-17.143q0-2.125 1.509-3.634t3.634-1.509h17.143zM12.464 16q0-1.571-1.107-2.679t-2.679-1.107-2.679 1.107-1.107 2.679 1.107 2.679 2.679 1.107 2.679-1.107 1.107-2.679zM22.536 16q0-1.571-1.107-2.679t-2.679-1.107-2.679 1.107-1.107 2.679 1.107 2.679 2.679 1.107 2.679-1.107 1.107-2.679z>/path>/symbol>symbol idicon-tumblr viewBox0 0 19 32>path classpath1 dM16.857 23.732l1.429 4.232q-0.411 0.625-1.982 1.179t-3.161 0.571q-1.857 0.036-3.402-0.464t-2.545-1.321-1.696-1.893-0.991-2.143-0.295-2.107v-9.714h-3v-3.839q1.286-0.464 2.304-1.241t1.625-1.607 1.036-1.821 0.607-1.768 0.268-1.58q0.018-0.089 0.080-0.152t0.134-0.063h4.357v7.571h5.946v4.5h-5.964v9.25q0 0.536 0.116 1t0.402 0.938 0.884 0.741 1.455 0.25q1.393-0.036 2.393-0.518z>/path>/symbol>symbol idicon-dockerhub viewBox0 0 24 28>path classpath1 dM1.597 10.257h2.911v2.83H1.597v-2.83zm3.573 0h2.91v2.83H5.17v-2.83zm0-3.627h2.91v2.829H5.17V6.63zm3.57 3.627h2.912v2.83H8.74v-2.83zm0-3.627h2.912v2.829H8.74V6.63zm3.573 3.627h2.911v2.83h-2.911v-2.83zm0-3.627h2.911v2.829h-2.911V6.63zm3.572 3.627h2.911v2.83h-2.911v-2.83zM12.313 3h2.911v2.83h-2.911V3zm-6.65 14.173c-.449 0-.812.354-.812.788 0 .435.364.788.812.788.447 0 .811-.353.811-.788 0-.434-.363-.788-.811-.788>/path>path classpath2 dM28.172 11.721c-.978-.549-2.278-.624-3.388-.306-.136-1.146-.91-2.149-1.83-2.869l-.366-.286-.307.345c-.618.692-.8 1.845-.718 2.73.063.651.273 1.312.685 1.834-.313.183-.668.328-.985.434-.646.212-1.347.33-2.028.33H.083l-.042.429c-.137 1.432.065 2.866.674 4.173l.262.519.03.048c1.8 2.973 4.963 4.225 8.41 4.225 6.672 0 12.174-2.896 14.702-9.015 1.689.085 3.417-.4 4.243-1.968l.211-.4-.401-.223zM5.664 19.458c-.85 0-1.542-.671-1.542-1.497 0-.825.691-1.498 1.541-1.498.849 0 1.54.672 1.54 1.497s-.69 1.498-1.539 1.498z>/path>/symbol>symbol idicon-dribbble viewBox0 0 27 32>path classpath1 dM18.286 26.786q-0.75-4.304-2.5-8.893h-0.036l-0.036 0.018q-0.286 0.107-0.768 0.295t-1.804 0.875-2.446 1.464-2.339 2.045-1.839 2.643l-0.268-0.196q3.286 2.679 7.464 2.679 2.357 0 4.571-0.929zM14.982 15.946q-0.375-0.875-0.946-1.982-5.554 1.661-12.018 1.661-0.018 0.125-0.018 0.375 0 2.214 0.786 4.223t2.214 3.598q0.893-1.589 2.205-2.973t2.545-2.223 2.33-1.446 1.777-0.857l0.661-0.232q0.071-0.018 0.232-0.063t0.232-0.080zM13.071 12.161q-2.143-3.804-4.357-6.75-2.464 1.161-4.179 3.321t-2.286 4.857q5.393 0 10.821-1.429zM25.286 17.857q-3.75-1.071-7.304-0.518 1.554 4.268 2.286 8.375 1.982-1.339 3.304-3.384t1.714-4.473zM10.911 4.625q-0.018 0-0.036 0.018 0.018-0.018 0.036-0.018zM21.446 7.214q-3.304-2.929-7.732-2.929-1.357 0-2.768 0.339 2.339 3.036 4.393 6.821 1.232-0.464 2.321-1.080t1.723-1.098 1.17-1.018 0.67-0.723zM25.429 15.875q-0.054-4.143-2.661-7.321l-0.018 0.018q-0.161 0.214-0.339 0.438t-0.777 0.795-1.268 1.080-1.786 1.161-2.348 1.152q0.446 0.946 0.786 1.696 0.036 0.107 0.116 0.313t0.134 0.295q0.643-0.089 1.33-0.125t1.313-0.036 1.232 0.027 1.143 0.071 1.009 0.098 0.857 0.116 0.652 0.107 0.446 0.080zM27.429 16q0 3.732-1.839 6.884t-4.991 4.991-6.884 1.839-6.884-1.839-4.991-4.991-1.839-6.884 1.839-6.884 4.991-4.991 6.884-1.839 6.884 1.839 4.991 4.991 1.839 6.884z>/path>/symbol>symbol idicon-skype viewBox0 0 27 32>path classpath1 dM20.946 18.982q0-0.893-0.348-1.634t-0.866-1.223-1.304-0.875-1.473-0.607-1.563-0.411l-1.857-0.429q-0.536-0.125-0.786-0.188t-0.625-0.205-0.536-0.286-0.295-0.375-0.134-0.536q0-1.375 2.571-1.375 0.768 0 1.375 0.214t0.964 0.509 0.679 0.598 0.714 0.518 0.857 0.214q0.839 0 1.348-0.571t0.509-1.375q0-0.982-1-1.777t-2.536-1.205-3.25-0.411q-1.214 0-2.357 0.277t-2.134 0.839-1.589 1.554-0.598 2.295q0 1.089 0.339 1.902t1 1.348 1.429 0.866 1.839 0.58l2.607 0.643q1.607 0.393 2 0.643 0.571 0.357 0.571 1.071 0 0.696-0.714 1.152t-1.875 0.455q-0.911 0-1.634-0.286t-1.161-0.688-0.813-0.804-0.821-0.688-0.964-0.286q-0.893 0-1.348 0.536t-0.455 1.339q0 1.643 2.179 2.813t5.196 1.17q1.304 0 2.5-0.33t2.188-0.955 1.58-1.67 0.589-2.348zM27.429 22.857q0 2.839-2.009 4.848t-4.848 2.009q-2.321 0-4.179-1.429-1.375 0.286-2.679 0.286-2.554 0-4.884-0.991t-4.018-2.679-2.679-4.018-0.991-4.884q0-1.304 0.286-2.679-1.429-1.857-1.429-4.179 0-2.839 2.009-4.848t4.848-2.009q2.321 0 4.179 1.429 1.375-0.286 2.679-0.286 2.554 0 4.884 0.991t4.018 2.679 2.679 4.018 0.991 4.884q0 1.304-0.286 2.679 1.429 1.857 1.429 4.179z>/path>/symbol>symbol idicon-foursquare viewBox0 0 23 32>path classpath1 dM17.857 7.75l0.661-3.464q0.089-0.411-0.161-0.714t-0.625-0.304h-12.714q-0.411 0-0.688 0.304t-0.277 0.661v19.661q0 0.125 0.107 0.018l5.196-6.286q0.411-0.464 0.679-0.598t0.857-0.134h4.268q0.393 0 0.661-0.259t0.321-0.527q0.429-2.321 0.661-3.411 0.071-0.375-0.205-0.714t-0.652-0.339h-5.25q-0.518 0-0.857-0.339t-0.339-0.857v-0.75q0-0.518 0.339-0.848t0.857-0.33h6.179q0.321 0 0.625-0.241t0.357-0.527zM21.911 3.786q-0.268 1.304-0.955 4.759t-1.241 6.25-0.625 3.098q-0.107 0.393-0.161 0.58t-0.25 0.58-0.438 0.589-0.688 0.375-1.036 0.179h-4.839q-0.232 0-0.393 0.179-0.143 0.161-7.607 8.821-0.393 0.446-1.045 0.509t-0.866-0.098q-0.982-0.393-0.982-1.75v-25.179q0-0.982 0.679-1.83t2.143-0.848h15.857q1.696 0 2.268 0.946t0.179 2.839zM21.911 3.786l-2.821 14.107q0.071-0.304 0.625-3.098t1.241-6.25 0.955-4.759z>/path>/symbol>symbol idicon-wordpress viewBox0 0 32 32>path classpath1 dM2.268 16q0-2.911 1.196-5.589l6.554 17.946q-3.5-1.696-5.625-5.018t-2.125-7.339zM25.268 15.304q0 0.339-0.045 0.688t-0.179 0.884-0.205 0.786-0.313 1.054-0.313 1.036l-1.357 4.571-4.964-14.75q0.821-0.054 1.571-0.143 0.339-0.036 0.464-0.33t-0.045-0.554-0.509-0.241l-3.661 0.179q-1.339-0.018-3.607-0.179-0.214-0.018-0.366 0.089t-0.205 0.268-0.027 0.33 0.161 0.295 0.348 0.143l1.429 0.143 2.143 5.857-3 9-5-14.857q0.821-0.054 1.571-0.143 0.339-0.036 0.464-0.33t-0.045-0.554-0.509-0.241l-3.661 0.179q-0.125 0-0.411-0.009t-0.464-0.009q1.875-2.857 4.902-4.527t6.563-1.67q2.625 0 5.009 0.946t4.259 2.661h-0.179q-0.982 0-1.643 0.723t-0.661 1.705q0 0.214 0.036 0.429t0.071 0.384 0.143 0.411 0.161 0.375 0.214 0.402 0.223 0.375 0.259 0.429 0.25 0.411q1.125 1.911 1.125 3.786zM16.232 17.196l4.232 11.554q0.018 0.107 0.089 0.196-2.25 0.786-4.554 0.786-2 0-3.875-0.571zM28.036 9.411q1.696 3.107 1.696 6.589 0 3.732-1.857 6.884t-4.982 4.973l4.196-12.107q1.054-3.018 1.054-4.929 0-0.75-0.107-1.411zM16 0q3.25 0 6.214 1.268t5.107 3.411 3.411 5.107 1.268 6.214-1.268 6.214-3.411 5.107-5.107 3.411-6.214 1.268-6.214-1.268-5.107-3.411-3.411-5.107-1.268-6.214 1.268-6.214 3.411-5.107 5.107-3.411 6.214-1.268zM16 31.268q3.089 0 5.92-1.214t4.875-3.259 3.259-4.875 1.214-5.92-1.214-5.92-3.259-4.875-4.875-3.259-5.92-1.214-5.92 1.214-4.875 3.259-3.259 4.875-1.214 5.92 1.214 5.92 3.259 4.875 4.875 3.259 5.92 1.214z>/path>/symbol>symbol idicon-stumbleupon viewBox0 0 34 32>path classpath1 dM18.964 12.714v-2.107q0-0.75-0.536-1.286t-1.286-0.536-1.286 0.536-0.536 1.286v10.929q0 3.125-2.25 5.339t-5.411 2.214q-3.179 0-5.42-2.241t-2.241-5.42v-4.75h5.857v4.679q0 0.768 0.536 1.295t1.286 0.527 1.286-0.527 0.536-1.295v-11.071q0-3.054 2.259-5.214t5.384-2.161q3.143 0 5.393 2.179t2.25 5.25v2.429l-3.482 1.036zM28.429 16.679h5.857v4.75q0 3.179-2.241 5.42t-5.42 2.241q-3.161 0-5.411-2.223t-2.25-5.366v-4.786l2.339 1.089 3.482-1.036v4.821q0 0.75 0.536 1.277t1.286 0.527 1.286-0.527 0.536-1.277v-4.911z>/path>/symbol>symbol idicon-digg viewBox0 0 37 32>path classpath1 dM5.857 5.036h3.643v17.554h-9.5v-12.446h5.857v-5.107zM5.857 19.661v-6.589h-2.196v6.589h2.196zM10.964 10.143v12.446h3.661v-12.446h-3.661zM10.964 5.036v3.643h3.661v-3.643h-3.661zM16.089 10.143h9.518v16.821h-9.518v-2.911h5.857v-1.464h-5.857v-12.446zM21.946 19.661v-6.589h-2.196v6.589h2.196zM27.071 10.143h9.5v16.821h-9.5v-2.911h5.839v-1.464h-5.839v-12.446zM32.911 19.661v-6.589h-2.196v6.589h2.196z>/path>/symbol>symbol idicon-spotify viewBox0 0 27 32>path classpath1 dM20.125 21.607q0-0.571-0.536-0.911-3.446-2.054-7.982-2.054-2.375 0-5.125 0.607-0.75 0.161-0.75 0.929 0 0.357 0.241 0.616t0.634 0.259q0.089 0 0.661-0.143 2.357-0.482 4.339-0.482 4.036 0 7.089 1.839 0.339 0.196 0.589 0.196 0.339 0 0.589-0.241t0.25-0.616zM21.839 17.768q0-0.714-0.625-1.089-4.232-2.518-9.786-2.518-2.732 0-5.411 0.75-0.857 0.232-0.857 1.143 0 0.446 0.313 0.759t0.759 0.313q0.125 0 0.661-0.143 2.179-0.589 4.482-0.589 4.982 0 8.714 2.214 0.429 0.232 0.679 0.232 0.446 0 0.759-0.313t0.313-0.759zM23.768 13.339q0-0.839-0.714-1.25-2.25-1.304-5.232-1.973t-6.125-0.67q-3.643 0-6.5 0.839-0.411 0.125-0.688 0.455t-0.277 0.866q0 0.554 0.366 0.929t0.92 0.375q0.196 0 0.714-0.143 2.375-0.661 5.482-0.661 2.839 0 5.527 0.607t4.527 1.696q0.375 0.214 0.714 0.214 0.518 0 0.902-0.366t0.384-0.92zM27.429 16q0 3.732-1.839 6.884t-4.991 4.991-6.884 1.839-6.884-1.839-4.991-4.991-1.839-6.884 1.839-6.884 4.991-4.991 6.884-1.839 6.884 1.839 4.991 4.991 1.839 6.884z>/path>/symbol>symbol idicon-soundcloud viewBox0 0 41 32>path classpath1 dM14 24.5l0.286-4.304-0.286-9.339q-0.018-0.179-0.134-0.304t-0.295-0.125q-0.161 0-0.286 0.125t-0.125 0.304l-0.25 9.339 0.25 4.304q0.018 0.179 0.134 0.295t0.277 0.116q0.393 0 0.429-0.411zM19.286 23.982l0.196-3.768-0.214-10.464q0-0.286-0.232-0.429-0.143-0.089-0.286-0.089t-0.286 0.089q-0.232 0.143-0.232 0.429l-0.018 0.107-0.179 10.339q0 0.018 0.196 4.214v0.018q0 0.179 0.107 0.304 0.161 0.196 0.411 0.196 0.196 0 0.357-0.161 0.161-0.125 0.161-0.357zM0.625 17.911l0.357 2.286-0.357 2.25q-0.036 0.161-0.161 0.161t-0.161-0.161l-0.304-2.25 0.304-2.286q0.036-0.161 0.161-0.161t0.161 0.161zM2.161 16.5l0.464 3.696-0.464 3.625q-0.036 0.161-0.179 0.161-0.161 0-0.161-0.179l-0.411-3.607 0.411-3.696q0-0.161 0.161-0.161 0.143 0 0.179 0.161zM3.804 15.821l0.446 4.375-0.446 4.232q0 0.196-0.196 0.196-0.179 0-0.214-0.196l-0.375-4.232 0.375-4.375q0.036-0.214 0.214-0.214 0.196 0 0.196 0.214zM5.482 15.696l0.411 4.5-0.411 4.357q-0.036 0.232-0.25 0.232-0.232 0-0.232-0.232l-0.375-4.357 0.375-4.5q0-0.232 0.232-0.232 0.214 0 0.25 0.232zM7.161 16.018l0.375 4.179-0.375 4.393q-0.036 0.286-0.286 0.286-0.107 0-0.188-0.080t-0.080-0.205l-0.357-4.393 0.357-4.179q0-0.107 0.080-0.188t0.188-0.080q0.25 0 0.286 0.268zM8.839 13.411l0.375 6.786-0.375 4.393q0 0.125-0.089 0.223t-0.214 0.098q-0.286 0-0.321-0.321l-0.321-4.393 0.321-6.786q0.036-0.321 0.321-0.321 0.125 0 0.214 0.098t0.089 0.223zM10.518 11.875l0.339 8.357-0.339 4.357q0 0.143-0.098 0.241t-0.241 0.098q-0.321 0-0.357-0.339l-0.286-4.357 0.286-8.357q0.036-0.339 0.357-0.339 0.143 0 0.241 0.098t0.098 0.241zM12.268 11.161l0.321 9.036-0.321 4.321q-0.036 0.375-0.393 0.375-0.339 0-0.375-0.375l-0.286-4.321 0.286-9.036q0-0.161 0.116-0.277t0.259-0.116q0.161 0 0.268 0.116t0.125 0.277zM19.268 24.411v0 0zM15.732 11.089l0.268 9.107-0.268 4.268q0 0.179-0.134 0.313t-0.313 0.134-0.304-0.125-0.143-0.321l-0.25-4.268 0.25-9.107q0-0.196 0.134-0.321t0.313-0.125 0.313 0.125 0.134 0.321zM17.5 11.429l0.25 8.786-0.25 4.214q0 0.196-0.143 0.339t-0.339 0.143-0.339-0.143-0.161-0.339l-0.214-4.214 0.214-8.786q0.018-0.214 0.161-0.357t0.339-0.143 0.33 0.143 0.152 0.357zM21.286 20.214l-0.25 4.125q0 0.232-0.161 0.393t-0.393 0.161-0.393-0.161-0.179-0.393l-0.107-2.036-0.107-2.089 0.214-11.357v-0.054q0.036-0.268 0.214-0.429 0.161-0.125 0.357-0.125 0.143 0 0.268 0.089 0.25 0.143 0.286 0.464zM41.143 19.875q0 2.089-1.482 3.563t-3.571 1.473h-14.036q-0.232-0.036-0.393-0.196t-0.161-0.393v-16.054q0-0.411 0.5-0.589 1.518-0.607 3.232-0.607 3.482 0 6.036 2.348t2.857 5.777q0.946-0.393 1.964-0.393 2.089 0 3.571 1.482t1.482 3.589z>/path>/symbol>symbol idicon-codepen viewBox0 0 32 32>path classpath1 dM3.857 20.875l10.768 7.179v-6.411l-5.964-3.982zM2.75 18.304l3.446-2.304-3.446-2.304v4.607zM17.375 28.054l10.768-7.179-4.804-3.214-5.964 3.982v6.411zM16 19.25l4.857-3.25-4.857-3.25-4.857 3.25zM8.661 14.339l5.964-3.982v-6.411l-10.768 7.179zM25.804 16l3.446 2.304v-4.607zM23.339 14.339l4.804-3.214-10.768-7.179v6.411zM32 11.125v9.75q0 0.732-0.607 1.143l-14.625 9.75q-0.375 0.232-0.768 0.232t-0.768-0.232l-14.625-9.75q-0.607-0.411-0.607-1.143v-9.75q0-0.732 0.607-1.143l14.625-9.75q0.375-0.232 0.768-0.232t0.768 0.232l14.625 9.75q0.607 0.411 0.607 1.143z>/path>/symbol>symbol idicon-twitch viewBox0 0 32 32>path classpath1 dM16 7.75v7.75h-2.589v-7.75h2.589zM23.107 7.75v7.75h-2.589v-7.75h2.589zM23.107 21.321l4.518-4.536v-14.196h-21.321v18.732h5.821v3.875l3.875-3.875h7.107zM30.214 0v18.089l-7.75 7.75h-5.821l-3.875 3.875h-3.875v-3.875h-7.107v-20.679l1.946-5.161h26.482z>/path>/symbol>symbol idicon-meanpath viewBox0 0 27 32>path classpath1 dM23.411 15.036v2.036q0 0.429-0.241 0.679t-0.67 0.25h-3.607q-0.429 0-0.679-0.25t-0.25-0.679v-2.036q0-0.429 0.25-0.679t0.679-0.25h3.607q0.429 0 0.67 0.25t0.241 0.679zM14.661 19.143v-4.464q0-0.946-0.58-1.527t-1.527-0.58h-2.375q-1.214 0-1.714 0.929-0.5-0.929-1.714-0.929h-2.321q-0.946 0-1.527 0.58t-0.58 1.527v4.464q0 0.393 0.375 0.393h0.982q0.393 0 0.393-0.393v-4.107q0-0.429 0.241-0.679t0.688-0.25h1.679q0.429 0 0.679 0.25t0.25 0.679v4.107q0 0.393 0.375 0.393h0.964q0.393 0 0.393-0.393v-4.107q0-0.429 0.25-0.679t0.679-0.25h1.732q0.429 0 0.67 0.25t0.241 0.679v4.107q0 0.393 0.393 0.393h0.982q0.375 0 0.375-0.393zM25.179 17.429v-2.75q0-0.946-0.589-1.527t-1.536-0.58h-4.714q-0.946 0-1.536 0.58t-0.589 1.527v7.321q0 0.375 0.393 0.375h0.982q0.375 0 0.375-0.375v-3.214q0.554 0.75 1.679 0.75h3.411q0.946 0 1.536-0.58t0.589-1.527zM27.429 6.429v19.143q0 1.714-1.214 2.929t-2.929 1.214h-19.143q-1.714 0-2.929-1.214t-1.214-2.929v-19.143q0-1.714 1.214-2.929t2.929-1.214h19.143q1.714 0 2.929 1.214t1.214 2.929z>/path>/symbol>symbol idicon-pinterest-p viewBox0 0 23 32>path classpath1 dM0 10.661q0-1.929 0.67-3.634t1.848-2.973 2.714-2.196 3.304-1.393 3.607-0.464q2.821 0 5.25 1.188t3.946 3.455 1.518 5.125q0 1.714-0.339 3.357t-1.071 3.161-1.786 2.67-2.589 1.839-3.375 0.688q-1.214 0-2.411-0.571t-1.714-1.571q-0.179 0.696-0.5 2.009t-0.42 1.696-0.366 1.268-0.464 1.268-0.571 1.116-0.821 1.384-1.107 1.545l-0.25 0.089-0.161-0.179q-0.268-2.804-0.268-3.357 0-1.643 0.384-3.688t1.188-5.134 0.929-3.625q-0.571-1.161-0.571-3.018 0-1.482 0.929-2.786t2.357-1.304q1.089 0 1.696 0.723t0.607 1.83q0 1.179-0.786 3.411t-0.786 3.339q0 1.125 0.804 1.866t1.946 0.741q0.982 0 1.821-0.446t1.402-1.214 1-1.696 0.679-1.973 0.357-1.982 0.116-1.777q0-3.089-1.955-4.813t-5.098-1.723q-3.571 0-5.964 2.313t-2.393 5.866q0 0.786 0.223 1.518t0.482 1.161 0.482 0.813 0.223 0.545q0 0.5-0.268 1.304t-0.661 0.804q-0.036 0-0.304-0.054-0.911-0.268-1.616-1t-1.089-1.688-0.58-1.929-0.196-1.902z>/path>/symbol>symbol idicon-periscope viewBox0 0 24 28>path classpath1 dM12.285,1C6.696,1,2.277,5.643,2.277,11.243c0,5.851,7.77,14.578,10.007,14.578c1.959,0,9.729-8.728,9.729-14.578 C22.015,5.643,17.596,1,12.285,1z M12.317,16.551c-3.473,0-6.152-2.611-6.152-5.664c0-1.292,0.39-2.472,1.065-3.438 c0.206,1.084,1.18,1.906,2.352,1.906c1.322,0,2.393-1.043,2.393-2.333c0-0.832-0.447-1.561-1.119-1.975 c0.467-0.105,0.955-0.161,1.46-0.161c3.133,0,5.81,2.611,5.81,5.998C18.126,13.94,15.449,16.551,12.317,16.551z>/path>/symbol>symbol idicon-get-pocket viewBox0 0 31 32>path classpath1 dM27.946 2.286q1.161 0 1.964 0.813t0.804 1.973v9.268q0 3.143-1.214 6t-3.259 4.911-4.893 3.259-5.973 1.205q-3.143 0-5.991-1.205t-4.902-3.259-3.268-4.911-1.214-6v-9.268q0-1.143 0.821-1.964t1.964-0.821h25.161zM15.375 21.286q0.839 0 1.464-0.589l7.214-6.929q0.661-0.625 0.661-1.518 0-0.875-0.616-1.491t-1.491-0.616q-0.839 0-1.464 0.589l-5.768 5.536-5.768-5.536q-0.625-0.589-1.446-0.589-0.875 0-1.491 0.616t-0.616 1.491q0 0.911 0.643 1.518l7.232 6.929q0.589 0.589 1.446 0.589z>/path>/symbol>symbol idicon-vimeo viewBox0 0 32 32>path classpath1 dM30.518 9.25q-0.179 4.214-5.929 11.625-5.946 7.696-10.036 7.696-2.536 0-4.286-4.696-0.786-2.857-2.357-8.607-1.286-4.679-2.804-4.679-0.321 0-2.268 1.357l-1.375-1.75q0.429-0.375 1.929-1.723t2.321-2.063q2.786-2.464 4.304-2.607 1.696-0.161 2.732 0.991t1.446 3.634q0.786 5.125 1.179 6.661 0.982 4.446 2.143 4.446 0.911 0 2.75-2.875 1.804-2.875 1.946-4.393 0.232-2.482-1.946-2.482-1.018 0-2.161 0.464 2.143-7.018 8.196-6.821 4.482 0.143 4.214 5.821z>/path>/symbol>symbol idicon-reddit-alien viewBox0 0 32 32>path classpath1 dM32 15.107q0 1.036-0.527 1.884t-1.42 1.295q0.214 0.821 0.214 1.714 0 2.768-1.902 5.125t-5.188 3.723-7.143 1.366-7.134-1.366-5.179-3.723-1.902-5.125q0-0.839 0.196-1.679-0.911-0.446-1.464-1.313t-0.554-1.902q0-1.464 1.036-2.509t2.518-1.045q1.518 0 2.589 1.125 3.893-2.714 9.196-2.893l2.071-9.304q0.054-0.232 0.268-0.375t0.464-0.089l6.589 1.446q0.321-0.661 0.964-1.063t1.411-0.402q1.107 0 1.893 0.777t0.786 1.884-0.786 1.893-1.893 0.786-1.884-0.777-0.777-1.884l-5.964-1.321-1.857 8.429q5.357 0.161 9.268 2.857 1.036-1.089 2.554-1.089 1.482 0 2.518 1.045t1.036 2.509zM7.464 18.661q0 1.107 0.777 1.893t1.884 0.786 1.893-0.786 0.786-1.893-0.786-1.884-1.893-0.777q-1.089 0-1.875 0.786t-0.786 1.875zM21.929 25q0.196-0.196 0.196-0.464t-0.196-0.464q-0.179-0.179-0.446-0.179t-0.464 0.179q-0.732 0.75-2.161 1.107t-2.857 0.357-2.857-0.357-2.161-1.107q-0.196-0.179-0.464-0.179t-0.446 0.179q-0.196 0.179-0.196 0.455t0.196 0.473q0.768 0.768 2.116 1.214t2.188 0.527 1.625 0.080 1.625-0.080 2.188-0.527 2.116-1.214zM21.875 21.339q1.107 0 1.884-0.786t0.777-1.893q0-1.089-0.786-1.875t-1.875-0.786q-1.107 0-1.893 0.777t-0.786 1.884 0.786 1.893 1.893 0.786z>/path>/symbol>symbol idicon-whatsapp viewBox0 0 32 32>path dM15.968 2.003a14.03 13.978 0 0 0-14.03 13.978 14.03 13.978 0 0 0 2.132 7.391L1.938 29.96l6.745-2.052a14.03 13.978 0 0 0 7.285 2.052 14.03 13.978 0 0 0 14.03-13.978 14.03 13.978 0 0 0-14.03-13.978z stroke-width.2000562/>path dM10.454 8.236a2.57 3.401 51.533 0 0-1.475 3.184v.015c.01 2.04 4.045 10.076 10.017 12.688l.017-.013a2.57 3.401 51.533 0 0 3.454-.706 2.57 3.401 51.533 0 0 1.064-4.129 2.57 3.401 51.533 0 0-4.262.103 2.57 3.401 51.533 0 0-.505.473c-1.346-.639-2.952-1.463-4.168-2.98-.771-.962-1.257-2.732-1.549-4.206a2.57 3.401 51.533 0 0 .605-.403 2.57 3.401 51.533 0 0 1.064-4.129 2.57 3.401 51.533 0 0-4.262.103z stroke-width.372/>/symbol>symbol idicon-telegram viewBox0 0 32 32>path dM30.8,2.2L0.6,13.9c-0.8,0.3-0.7,1.3,0,1.6l7.4,2.8l2.9,9.2c0.2,0.6,0.9,0.8,1.4,0.4l4.1-3.4 c0.4-0.4,1-0.4,1.5,0l7.4,5.4c0.5,0.4,1.2,0.1,1.4-0.5L32,3.2C32.1,2.5,31.4,1.9,30.8,2.2z M25,8.3l-11.9,11 c-0.4,0.4-0.7,0.9-0.8,1.5l-0.4,3c-0.1,0.4-0.6,0.4-0.7,0.1l-1.6-5.5c-0.2-0.6,0.1-1.3,0.6-1.6l14.4-8.9C25,7.7,25.3,8.1,25,8.3z/>/symbol>symbol idicon-hashtag viewBox0 0 32 32>path classpath1 dM17.696 18.286l1.143-4.571h-4.536l-1.143 4.571h4.536zM31.411 9.286l-1 4q-0.125 0.429-0.554 0.429h-5.839l-1.143 4.571h5.554q0.268 0 0.446 0.214 0.179 0.25 0.107 0.5l-1 4q-0.089 0.429-0.554 0.429h-5.839l-1.446 5.857q-0.125 0.429-0.554 0.429h-4q-0.286 0-0.464-0.214-0.161-0.214-0.107-0.5l1.393-5.571h-4.536l-1.446 5.857q-0.125 0.429-0.554 0.429h-4.018q-0.268 0-0.446-0.214-0.161-0.214-0.107-0.5l1.393-5.571h-5.554q-0.268 0-0.446-0.214-0.161-0.214-0.107-0.5l1-4q0.125-0.429 0.554-0.429h5.839l1.143-4.571h-5.554q-0.268 0-0.446-0.214-0.179-0.25-0.107-0.5l1-4q0.089-0.429 0.554-0.429h5.839l1.446-5.857q0.125-0.429 0.571-0.429h4q0.268 0 0.446 0.214 0.161 0.214 0.107 0.5l-1.393 5.571h4.536l1.446-5.857q0.125-0.429 0.571-0.429h4q0.268 0 0.446 0.214 0.161 0.214 0.107 0.5l-1.393 5.571h5.554q0.268 0 0.446 0.214 0.161 0.214 0.107 0.5z>/path>/symbol>symbol idicon-chain viewBox0 0 30 32>path classpath1 dM26 21.714q0-0.714-0.5-1.214l-3.714-3.714q-0.5-0.5-1.214-0.5-0.75 0-1.286 0.571 0.054 0.054 0.339 0.33t0.384 0.384 0.268 0.339 0.232 0.455 0.063 0.491q0 0.714-0.5 1.214t-1.214 0.5q-0.268 0-0.491-0.063t-0.455-0.232-0.339-0.268-0.384-0.384-0.33-0.339q-0.589 0.554-0.589 1.304 0 0.714 0.5 1.214l3.679 3.696q0.482 0.482 1.214 0.482 0.714 0 1.214-0.464l2.625-2.607q0.5-0.5 0.5-1.196zM13.446 9.125q0-0.714-0.5-1.214l-3.679-3.696q-0.5-0.5-1.214-0.5-0.696 0-1.214 0.482l-2.625 2.607q-0.5 0.5-0.5 1.196 0 0.714 0.5 1.214l3.714 3.714q0.482 0.482 1.214 0.482 0.75 0 1.286-0.554-0.054-0.054-0.339-0.33t-0.384-0.384-0.268-0.339-0.232-0.455-0.063-0.491q0-0.714 0.5-1.214t1.214-0.5q0.268 0 0.491 0.063t0.455 0.232 0.339 0.268 0.384 0.384 0.33 0.339q0.589-0.554 0.589-1.304zM29.429 21.714q0 2.143-1.518 3.625l-2.625 2.607q-1.482 1.482-3.625 1.482-2.161 0-3.643-1.518l-3.679-3.696q-1.482-1.482-1.482-3.625 0-2.196 1.571-3.732l-1.571-1.571q-1.536 1.571-3.714 1.571-2.143 0-3.643-1.5l-3.714-3.714q-1.5-1.5-1.5-3.643t1.518-3.625l2.625-2.607q1.482-1.482 3.625-1.482 2.161 0 3.643 1.518l3.679 3.696q1.482 1.482 1.482 3.625 0 2.196-1.571 3.732l1.571 1.571q1.536-1.571 3.714-1.571 2.143 0 3.643 1.5l3.714 3.714q1.5 1.5 1.5 3.643z>/path>/symbol>symbol idicon-thumb-tack viewBox0 0 21 32>path classpath1 dM8.571 15.429v-8q0-0.25-0.161-0.411t-0.411-0.161-0.411 0.161-0.161 0.411v8q0 0.25 0.161 0.411t0.411 0.161 0.411-0.161 0.161-0.411zM20.571 21.714q0 0.464-0.339 0.804t-0.804 0.339h-7.661l-0.911 8.625q-0.036 0.214-0.188 0.366t-0.366 0.152h-0.018q-0.482 0-0.571-0.482l-1.357-8.661h-7.214q-0.464 0-0.804-0.339t-0.339-0.804q0-2.196 1.402-3.955t3.17-1.759v-9.143q-0.929 0-1.607-0.679t-0.679-1.607 0.679-1.607 1.607-0.679h11.429q0.929 0 1.607 0.679t0.679 1.607-0.679 1.607-1.607 0.679v9.143q1.768 0 3.17 1.759t1.402 3.955z>/path>/symbol>symbol idicon-arrow-left viewBox0 0 43 32>path classpath1 dM42.311 14.044c-0.178-0.178-0.533-0.356-0.711-0.356h-33.778l10.311-10.489c0.178-0.178 0.356-0.533 0.356-0.711 0-0.356-0.178-0.533-0.356-0.711l-1.6-1.422c-0.356-0.178-0.533-0.356-0.889-0.356s-0.533 0.178-0.711 0.356l-14.578 14.933c-0.178 0.178-0.356 0.533-0.356 0.711s0.178 0.533 0.356 0.711l14.756 14.933c0 0.178 0.356 0.356 0.533 0.356s0.533-0.178 0.711-0.356l1.6-1.6c0.178-0.178 0.356-0.533 0.356-0.711s-0.178-0.533-0.356-0.711l-10.311-10.489h33.778c0.178 0 0.533-0.178 0.711-0.356 0.356-0.178 0.533-0.356 0.533-0.711v-2.133c0-0.356-0.178-0.711-0.356-0.889z>/path>/symbol>symbol idicon-arrow-right viewBox0 0 43 32>path classpath1 dM0.356 17.956c0.178 0.178 0.533 0.356 0.711 0.356h33.778l-10.311 10.489c-0.178 0.178-0.356 0.533-0.356 0.711 0 0.356 0.178 0.533 0.356 0.711l1.6 1.6c0.178 0.178 0.533 0.356 0.711 0.356s0.533-0.178 0.711-0.356l14.756-14.933c0.178-0.356 0.356-0.711 0.356-0.889s-0.178-0.533-0.356-0.711l-14.756-14.933c0-0.178-0.356-0.356-0.533-0.356s-0.533 0.178-0.711 0.356l-1.6 1.6c-0.178 0.178-0.356 0.533-0.356 0.711s0.178 0.533 0.356 0.711l10.311 10.489h-33.778c-0.178 0-0.533 0.178-0.711 0.356-0.356 0.178-0.533 0.356-0.533 0.711v2.311c0 0.178 0.178 0.533 0.356 0.711z>/path>/symbol>symbol idicon-play viewBox0 0 22 28>path dM21.625 14.484l-20.75 11.531c-0.484 0.266-0.875 0.031-0.875-0.516v-23c0-0.547 0.391-0.781 0.875-0.516l20.75 11.531c0.484 0.266 0.484 0.703 0 0.969z>/path>/symbol>symbol idicon-pause viewBox0 0 24 28>path dM24 3v22c0 0.547-0.453 1-1 1h-8c-0.547 0-1-0.453-1-1v-22c0-0.547 0.453-1 1-1h8c0.547 0 1 0.453 1 1zM10 3v22c0 0.547-0.453 1-1 1h-8c-0.547 0-1-0.453-1-1v-22c0-0.547 0.453-1 1-1h8c0.547 0 1 0.453 1 1z>/path>/symbol>/defs>/svg>/body>/html>
View on OTX
|
View on ThreatMiner
Please enable JavaScript to view the
comments powered by Disqus.
Data with thanks to
AlienVault OTX
,
VirusTotal
,
Malwr
and
others
. [
Sitemap
]