Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions idl/mdsconnect.pro
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ pro Mds$SendArg,sock,n,idx,arg
return
end

; This procedure is likely obsolete
Copy link
Contributor Author

@mwinkel-dev mwinkel-dev Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This procedure is not used anywhere in the MDSplus source code. Plus it appears to be replaced by the mdsconnect procedure.

However, there is a chance that customers have old IDL programs that use this routine.

We should select one of these options:

  • delete the procedure, or
  • keep the procedure, or
  • add a print statement to it indicating that it is deprecated and the user should instead use mdsconnect

pro mds$connect,host,status=status,quiet=quiet,port=port
on_error,2
mds$disconnect,/quiet
Expand Down Expand Up @@ -141,16 +142,15 @@ pro mds$disconnect,status=status,quiet=quiet
return
end


; This procedure is likely obsolete
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete, keep or deprecate?

pro connect,host,_EXTRA=e
mds$connect,host,_EXTRA=e
return
end

;*/


pro mdsconnect,host,status=status,quiet=quiet,port=port,socket=socket
; This procedure is used to connect to MDSplus archive servers and to database servers
pro mdsconnect,host,status=status,quiet=quiet,port=port,socket=socket,database=database
forward_function mds_keyword_set
on_error,2
if (not mds_keyword_set(socket=socket)) then $
Expand All @@ -163,9 +163,16 @@ pro mdsconnect,host,status=status,quiet=quiet,port=port,socket=socket
sockmin=sockmin()
if (sock ge sockmin) then begin
status = 1
if not mds_keyword_set(socket=socket) then $
!MDS_SOCKET = sock $
else $
; The !MDS_SOCKET only tracks connections to MDSplus archive servers. See MDSDbConnect for database connections.
if not keyword_set(database) then begin
defsysv, '!MDS_SOCKET', exists=conn
if not conn then begin
defsysv, '!MDS_SOCKET', fix(sock)
endif else begin
!MDS_SOCKET = fix(sock)
endelse
endif
if mds_keyword_set(socket=socket) then $
socket = sock
endif else begin
if not keyword_set(quiet) then message,'Error connecting to '+host,/IOERROR
Expand Down
2 changes: 1 addition & 1 deletion idl/mdssql.pro
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pro MDSDbConnect, host
endif
if (host ne "" and host ne "local") then begin
socket=-1
MdsConnect, host, socket=socket
MdsConnect, host, socket=socket, /database
!MDSDB_SOCKET = socket
!MDSDB_HOST=host
endif
Expand Down
2 changes: 1 addition & 1 deletion idl/set_database.pro
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ pro MDSDbConnect, host
endif
if (host ne "" and host ne "local") then begin
socket=-1
MdsConnect, host, socket=socket
MdsConnect, host, socket=socket, /database
!MDSDB_SOCKET = socket
!MDSDB_HOST=host
endif
Expand Down