<?xml version='1.0' encoding='utf-8' ?>

<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/'>
<channel>
  <title>network</title>
  <lastBuildDate>Mon, 07 Oct 2013 15:58:22 GMT</lastBuildDate>
  <generator>LiveJournal / SAPO Campus Blogs</generator>
<item>
  <guid isPermaLink='true'>http://chatinc.blogs.ua.sapo.pt/389.html</guid>
  <pubDate>Mon, 07 Oct 2013 15:58:22 GMT</pubDate>
  <title>Chat in C Programming Language (server side)</title>
  <author>fxsf</author>  <link>http://chatinc.blogs.ua.sapo.pt/389.html</link>
  <description>&lt;h5&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;(Code Below) &lt;/span&gt;&lt;/h5&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;I created this project to use several computers to communicate between them. This program launches a server in one IP address and one Port, and then you can connect to this server through TELNET protocol:&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://fotos.ua.sapo.pt/6Vn6Fww6737plSGO9gdk/450x190&quot; width=&quot;450&quot; height=&quot;190&quot; border=&quot;0&quot; style=&quot;border-color:black;&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;After all the clients being connected to the server, anyone can communicate a message. For that, a peer sends a message to the server, and the server will Broadcast that message onto every other participant:&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://fotos.ua.sapo.pt/zEbqWGstYbUJFG4LJth1/450x300&quot; width=&quot;450&quot; height=&quot;300&quot; border=&quot;0&quot; style=&quot;border-color:black;&quot; alt=&quot;&quot; /&gt;  &lt;img src=&quot;http://fotos.ua.sapo.pt/eOuytr7AFhDOpQurDKON/450x230&quot; width=&quot;450&quot; height=&quot;230&quot; border=&quot;0&quot; style=&quot;border-color:black;&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;And that&apos;s how it works. It is a system that allows you to communicate with everyone inside the network (A bit like a Hangout with just text). This is useful in case you want to create some system that is able to send commands to some computer (i.e. like sending a command from your phone/tablet to the server, to make the server open a door or start recording some video from a webcam)... etc. The possibilities are endless here. For that, you can grab this code and just focus on parsing the text and redirecting commands accordingly... the rest is done.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Some prints on how it works:&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;1 - Compiling and starting the server on a given port (if you don&apos;t enter the port, the default port will be 1234)&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://fotos.ua.sapo.pt/JzdSdQCwi7q8V1NN7OqC/900x410&quot; width=&quot;900&quot; height=&quot;550&quot; border=&quot;0&quot; style=&quot;border-color:black;&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;2 - Connect a client. For this you don&apos;t need to create a program client... you can use the TELNET protocol available both in unix/windows. Use the server and the port to connect to our server: &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://fotos.ua.sapo.pt/T75J7d62ZyrOASlDMvAd/550x410&quot; width=&quot;900&quot; height=&quot;550&quot; border=&quot;0&quot; style=&quot;border-color:black;&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;If the connection is not ok, it will be refused and closed. If it succeedes as intended, the outcome will be a greeting.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;3 - After doing it with 2 PCs (1 with Ubuntu, 1 with XP), the server tells you that it successfully linked 2 peers:&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://fotos.ua.sapo.pt/yuzCpfOzfsKn9Ef6nzip/550x413&quot; width=&quot;900&quot; height=&quot;550&quot; border=&quot;0&quot; style=&quot;border-color:black;&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;I limited the code to accept just 3 peers. To any adjustment, alter the code ;)&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;4 - To send a message, type it in the client and hit enter.&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://fotos.ua.sapo.pt/26iocezTvuw6Ft3ahPeO/550x413&quot; width=&quot;900&quot; height=&quot;550&quot; border=&quot;0&quot; style=&quot;border-color:black;&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;5 - This is the other TELNET client in windows. You start it in the same way you do in Linux (open the windows console and type:     telnet     server      port). The outcome is a window that will show every message sent from other peers. As proof, the next image shows the text typed in the Linux client.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://fotos.ua.sapo.pt/dnKouGTSWJKIGZ043Kg3/550x309&quot; width=&quot;900&quot; height=&quot;550&quot; border=&quot;0&quot; style=&quot;border-color:black;&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;It also works on Android (in fact, it works in any platform, as long as you have a TELNET client):&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://fotos.ua.sapo.pt/VFoqLrBG9U320Uzes1j8/&quot; width=&quot;900&quot; height=&quot;550&quot; border=&quot;0&quot; style=&quot;border-color:black;&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;It works and is multi platform ^_^&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Code:  &lt;a href=&quot;http://nn7.xz.sl.pt&quot; title=&quot;Ficheiro http://nn7.xz.sl.pt&quot;&gt;sockets.cpp&lt;/a&gt;  &lt;a href=&quot;http://nn7.y5.sl.pt&quot; title=&quot;Ficheiro http://nn7.y5.sl.pt&quot;&gt;ip.cpp&lt;/a&gt;  &lt;a href=&quot;http://nn7.yp.sl.pt&quot; title=&quot;Ficheiro http://nn7.yp.sl.pt&quot;&gt;ip.h&lt;/a&gt;&lt;/p&gt;</description>
</item>
<item>
  <guid isPermaLink='true'>http://esd.blogs.ua.sapo.pt/12564.html</guid>
  <pubDate>Thu, 07 Apr 2011 09:25:10 GMT</pubDate>
  <title>INFORMAR projecto network - apresentação</title>
  <author>patricia-ferreira-c</author>  <link>http://esd.blogs.ua.sapo.pt/12564.html</link>
  <description>&lt;div&gt;&lt;param name=&quot;movie&quot; value=&quot;http://static.issuu.com/webembed/viewers/style1/v1/IssuuViewer.swf?mode=embed&amp;amp;viewMode=presentation&amp;amp;layout=http%3A%2F%2Fskin.issuu.com%2Fv%2Flight%2Flayout.xml&amp;amp;showFlipBtn=true&amp;amp;documentId=110407092841-2205ce9871ba4c6aaf05bdf38d8c765d&amp;amp;docName=network_apresenta__&amp;amp;username=since&amp;amp;loadingInfoText=Network%20ergonomia%20social%20design%20-%20informar&amp;amp;et=1302169481191&amp;amp;er=75&quot; /&gt;&lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;menu&quot; value=&quot;false&quot; /&gt;&lt;embed src=&quot;http://static.issuu.com/webembed/viewers/style1/v1/IssuuViewer.swf&quot; type=&quot;application/x-shockwave-flash&quot; allowfullscreen=&quot;true&quot; menu=&quot;false&quot; style=&quot;width:600px;height:450px&quot; flashvars=&quot;mode=embed&amp;amp;viewMode=presentation&amp;amp;layout=http%3A%2F%2Fskin.issuu.com%2Fv%2Flight%2Flayout.xml&amp;amp;showFlipBtn=true&amp;amp;documentId=110407092841-2205ce9871ba4c6aaf05bdf38d8c765d&amp;amp;docName=network_apresenta__&amp;amp;username=since&amp;amp;loadingInfoText=Network%20ergonomia%20social%20design%20-%20informar&amp;amp;et=1302169481191&amp;amp;er=75&quot; /&gt;&lt;div style=&quot;width:600px;text-align:left;&quot;&gt;&lt;a href=&quot;http://issuu.com/since/docs/network_apresenta__?mode=embed&amp;amp;viewMode=presentation&amp;amp;layout=http%3A%2F%2Fskin.issuu.com%2Fv%2Flight%2Flayout.xml&amp;amp;showFlipBtn=true&quot; target=&quot;_blank&quot;&gt;Open publication&lt;/a&gt; - Free &lt;a href=&quot;http://issuu.com&quot; target=&quot;_blank&quot;&gt;publishing&lt;/a&gt; - &lt;a href=&quot;http://issuu.com/search?q=design&quot; target=&quot;_blank&quot;&gt;More design&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;</description>
</item>
</channel>
</rss>
