diff options
Diffstat (limited to 'request.f90')
-rw-r--r-- | request.f90 | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/request.f90 b/request.f90 index 3cc8cbf..67cc4f7 100644 --- a/request.f90 +++ b/request.f90 @@ -13,6 +13,16 @@ implicit none integer, parameter::CONNECTION_SSL_CONN_FAILURE = 5 integer, parameter::CONNECTION_OPEN = 6 + character(23), dimension(0:6), parameter:: connection_code_str = & + ["No Connection ", & + "Connection Closed ", & + "Server Not Found ", & + "Local Socket Failure ", & + "SSL Configuration Error", & + "SSL Connection Failure ", & + "SSL Connection Open " ] + + type :: connection integer::code @@ -26,6 +36,25 @@ implicit none contains + function translate_connection_code(code) + implicit none + + integer, intent(in)::code + character(23)::translate_connection_code + + if(code >= lbound(connection_code_str, 1) .and. & + code <= ubound(connection_code_str, 1)) then + + translate_connection_code = connection_code_str(code) + + else + + translate_connection_code = "Unknown Error" + + end if + + end function translate_connection_code + function open_connection(server, port) result(conn) use jessl use network |