File: clientid.R

package info (click to toggle)
r-cran-seqinr 3.4-5-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,876 kB
  • sloc: ansic: 1,987; makefile: 14
file content (21 lines) | stat: -rw-r--r-- 819 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# ==> clientid&id="xxxxx"
# <==  code=0
# Sends the server an identification of the client, typically a program name.

clientid <- function(id = paste("seqinr_", packageDescription("seqinr")$Version, sep = ""), socket, verbose = FALSE){
  #
  # Client ID definition : seqinr + package version number
  #  (internal note: log file is: /mnt/users/ADE-User/racnuc/log)
  #
  request <- paste("clientid&id=", id, sep = "")
  if(verbose) cat(paste("clientid(): sending", request, "\n"))
  writeLines( request, socket, sep = "\n")
  rep <- readLines(socket, n = 1)
  if(verbose) cat(paste("... answer from server is:", rep, "\n"))
  res <- parser.socket(rep, verbose = verbose)
  if( res[1] != "0") {
    print(rep)
    stop("I don't know what this error code means for clientid, please contact package maintener.\n")
  }
}