/[svn]/linuxsampler/trunk/src/shell/LSCPClient.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/shell/LSCPClient.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3053 by schoenebeck, Tue Apr 15 19:35:35 2014 UTC revision 3054 by schoenebeck, Thu Dec 15 12:47:45 2016 UTC
# Line 1  Line 1 
1  /*  /*
2   * LSCP Shell   * LSCP Shell
3   *   *
4   * Copyright (c) 2014 Christian Schoenebeck   * Copyright (c) 2014 - 2016 Christian Schoenebeck
5   *   *
6   * This program is part of LinuxSampler and released under the same terms.   * This program is part of LinuxSampler and released under the same terms.
7   */   */
# Line 145  bool LSCPClient::send(char c) { Line 145  bool LSCPClient::send(char c) {
145  bool LSCPClient::send(String s) {  bool LSCPClient::send(String s) {
146      //lscpLog("[send] '%s'\n", s.c_str());      //lscpLog("[send] '%s'\n", s.c_str());
147      if (!isConnected()) return false;      if (!isConnected()) return false;
148      int n = ::write(hSocket, &s[0], s.size());      int n = (int) ::write(hSocket, &s[0], s.size());
149      return n == s.size();      return n == s.size();
150  }  }
151    
# Line 296  void LSCPClient::setErrorCallback(Callba Line 296  void LSCPClient::setErrorCallback(Callba
296  optional<String> LSCPClient::receiveLine() {  optional<String> LSCPClient::receiveLine() {
297      if (!isConnected()) return optional<String>::nothing;      if (!isConnected()) return optional<String>::nothing;
298      for (char c; true; ) {      for (char c; true; ) {
299          int n = ::read(hSocket, &c, 1);          int n = (int) ::read(hSocket, &c, 1);
300          if (n < 1) return optional<String>::nothing;          if (n < 1) return optional<String>::nothing;
301          if (c == '\r') continue;          if (c == '\r') continue;
302          if (c == '\n') {          if (c == '\n') {

Legend:
Removed from v.3053  
changed lines
  Added in v.3054

  ViewVC Help
Powered by ViewVC