aboutsummaryrefslogtreecommitdiff
path: root/common/network.F90
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2021-04-16 11:33:11 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2021-04-16 11:33:11 -0400
commita60a9d10ce94acc0c5bfed2a20c8bed4e91be725 (patch)
tree59cfacd7c0460817b434768fac12a8c56ae2c946 /common/network.F90
parentefb5d8cec9531637c91fc1087f9c83b4d89a5612 (diff)
downloadlevitating-a60a9d10ce94acc0c5bfed2a20c8bed4e91be725.tar.gz
levitating-a60a9d10ce94acc0c5bfed2a20c8bed4e91be725.zip
Fixed issue with connect calls that were manifested on macOS.
Diffstat (limited to 'common/network.F90')
-rw-r--r--common/network.F9019
1 files changed, 17 insertions, 2 deletions
diff --git a/common/network.F90 b/common/network.F90
index f986275..8cefd1a 100644
--- a/common/network.F90
+++ b/common/network.F90
@@ -72,7 +72,7 @@ implicit none
end type
#endif
- integer(kind=c_size_t), parameter::sockaddr_size = 56
+ integer(kind=c_size_t), parameter::sockaddr_size = 16
interface
function socket_c(i, j, k) bind(c, name="socket")
@@ -120,6 +120,18 @@ implicit none
integer(kind=c_int)::close_c
end function close_c
+ !subroutine memset_c(p, v, n) bind(c, name="memset")
+ !use iso_c_binding
+ !type(c_ptr), value::p
+ !integer(kind=c_int), value::v, n
+ !end subroutine memset_c
+
+ ! Debugging routine
+ !subroutine output_sa(p) bind(c, name="output_sa")
+ !use iso_c_binding
+ !type(c_ptr), value::p
+ !end subroutine output_sa
+
end interface
contains
@@ -237,7 +249,10 @@ implicit none
integer::sockfd
type(sockaddr_in), target::sock_addr
logical::connect
-
+
+ ! Just for debugging
+ !call output_sa(c_loc(sock_addr))
+
connect = (connect_c(int(sockfd, kind=c_int), &
c_loc(sock_addr), &
sockaddr_size) .eq. 0)