aboutsummaryrefslogtreecommitdiff
path: root/common/network.F90
diff options
context:
space:
mode:
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)