<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Fortran TCP/IP sockets]]></title>
		<link>https://forums.approximatrix.com/viewtopic.php?id=771</link>
		<atom:link href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=771&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Fortran TCP/IP sockets.]]></description>
		<lastBuildDate>Fri, 18 Sep 2020 12:31:38 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Fortran TCP/IP sockets]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3586#p3586</link>
			<description><![CDATA[<p>Pete,</p><p>If you want to use SSL as well, you need to add these flags to the Linker box in Compiler Flags:<br /></p><div class="codebox"><pre><code>-lssl -lcrypto -lws2_32 -lcrypt32</code></pre></div><p>You might also need to tell the compiler where these libraries are unless you extracted that distribution of OpenSSL directly in your project directory.&nbsp; You&#039;ll need to add them using the <a href="http://simplyfortran.com/docs/full/windows/options/project.html">File Locations section in Project Options</a>.</p><p>If you&#039;re just experimenting with sockets, though, you might want to stay away from SSL.&nbsp; It simply adds another layer of complexity that you probably don&#039;t need right now.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Fri, 18 Sep 2020 12:31:38 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3586#p3586</guid>
		</item>
		<item>
			<title><![CDATA[Re: Fortran TCP/IP sockets]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3583#p3583</link>
			<description><![CDATA[<p>Hi Jeff,<br />That worked great but it brought another raft of problems in the linking. In your example files there was a &quot;use jessl&quot; statement. I found jessl and included it in my little test piece but it refers to a lot of SSL functions. Thinking they were useful too, I downloaded the SSL library that you recommended in that project. Now the issue I have is (of course) undefined references to the SSL functions and I don&#039;t know how to link the SSL library into my program. I looked in the documentation,but it&#039;s not covered. I&#039;m sorry to keep asking newbie questions, but in all my Fortran work, I have never had to link to an external library of any sort and it&#039;s a mystery to me. Can you help with this too? Or maybe point me towards doumentation that I may have overlooked?<br />Regards,<br />Pete</p>]]></description>
			<author><![CDATA[null@example.com (peter.kelly)]]></author>
			<pubDate>Fri, 18 Sep 2020 06:55:50 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3583#p3583</guid>
		</item>
		<item>
			<title><![CDATA[Re: Fortran TCP/IP sockets]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3582#p3582</link>
			<description><![CDATA[<p>Yes, you need to link with the Windows Sockets library.&nbsp; In Project Options, you would have to add the following:<br /></p><div class="codebox"><pre><code>-lws2_32</code></pre></div><p>to the Linker box under &quot;Compiler Flags&quot; to use sockets.&nbsp; This library is included in our distribution.</p><p>Also, make sure, on Windows, that you call <em>WSAStartup</em> very early in your program or all your socket operations will fail.&nbsp; This function is Windows-specific, but everything else that was network-related in the linked project is completely portable to Linux, macOS, BSD, etc.&nbsp; My wrapper for <em>WSAStartup</em> is in <a href="http://git.rainbow-100.com/cgit.cgi/LR-87/tree/wsa.f90">wsa.f90</a>.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Thu, 17 Sep 2020 12:04:26 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3582#p3582</guid>
		</item>
		<item>
			<title><![CDATA[Re: Fortran TCP/IP sockets]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3581#p3581</link>
			<description><![CDATA[<p>Hi Jeff.<br />Thank you for replying so quickly. The code that you posted was very helpful in understanding the area. However, when I put it together to simply test if I could open a socket, I got linker errors for the underlying C functions ie &quot;undefined reference to `socket&#039; &quot;.<br />I can easily see the bindings from Fortran to the underlying C functions in the code but I seem to be missing the C functions. Is there another library that I need to link it? (If so, how?) I&#039;ve poured over the whole project but can&#039;t see anything. <br />Regards,<br />Peter</p>]]></description>
			<author><![CDATA[null@example.com (peter.kelly)]]></author>
			<pubDate>Thu, 17 Sep 2020 03:12:41 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3581#p3581</guid>
		</item>
		<item>
			<title><![CDATA[Re: Fortran TCP/IP sockets]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3580#p3580</link>
			<description><![CDATA[<p>Using the older library almost certainly won&#039;t work with Simply Fortran.&nbsp; As an exercise, though, I&#039;ve written a browser in pure Fortran for the <a href="https://gemini.circumlunar.space/">Gemini protocol</a>, a sort of simpler-than-the-web Internet experience.&nbsp; In doing so, I wrote a pretty minimal socket interface that works on Windows and Linux, shown here in <a href="http://git.rainbow-100.com/cgit.cgi/LR-87/tree/network.F90">network.F90</a> that wraps socket functions in Fortran.&nbsp; Windows has the added step of <a href="http://git.rainbow-100.com/cgit.cgi/LR-87/tree/wsa.f90">initializing any application that will use TCP/IP</a>, so be careful.</p><p>The sockets are then used pretty much as you would in C.&nbsp; In that project, the <em>open_connection</em> function in <a href="http://git.rainbow-100.com/cgit.cgi/LR-87/tree/request.f90">request.f90</a> shows how the socket would be handled at a low level.</p><p>Hopefully some of this is helpful.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Tue, 15 Sep 2020 12:33:36 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3580#p3580</guid>
		</item>
		<item>
			<title><![CDATA[Fortran TCP/IP sockets]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3579#p3579</link>
			<description><![CDATA[<p>Hi There!<br />I wanted to write a pair of Fortran programs that would communicate to each other over a Network. As such, I had a good look around the internet but couldn&#039;t find much at all. Do you know of a Fortran Sockets implementation? <br />Further to that, I did find an antique Intel Fortran implementation of a baby sized &quot;Proof of Concept&quot; Fortran program that used Sockets. However, it depends on the Visual Studio library &quot;Wininit.lib&quot; to define the sockets etc.&nbsp; I did get my hands on a copy of the *.lib file, but I have no idea how to link it it. Can you help me with that too?<br />Any help is really appreciated. <br />Regards,<br />Pete</p>]]></description>
			<author><![CDATA[null@example.com (peter.kelly)]]></author>
			<pubDate>Tue, 15 Sep 2020 08:58:06 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3579#p3579</guid>
		</item>
	</channel>
</rss>
