Changeset 3451 for trunk/packages
- Timestamp:
- Mar 4, 2013, 8:10:40 PM (12 years ago)
- Location:
- trunk/packages/vizservers/vtkvis
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/ResponseQueue.h
r3330 r3451 32 32 LEGEND, /**< Legend to be displayed. */ 33 33 DATA, /**< Any other type of non-error message. */ 34 ERROR /**< Error message. */ 34 ERROR, /**< Error message. */ 35 OK /**< Ack for client when no render required */ 35 36 }; 36 37 -
trunk/packages/vizservers/vtkvis/RpVtkRenderServer.cpp
r3403 r3451 196 196 #endif /*USE_THREADS*/ 197 197 198 #ifndef STATSDIR 199 #define STATSDIR "/var/tmp/visservers" 200 #endif /*STATSDIR*/ 198 static int sendAck(ClientData clientData, int fdOut) 199 { 200 std::ostringstream oss; 201 oss << "nv>ok -token " << g_stats.nCommands << "\n"; 202 int nBytes = oss.str().length(); 203 204 TRACE("Sending OK for commands through %lu", g_stats.nCommands); 205 #ifdef USE_THREADS 206 queueResponse(clientData, oss.str().c_str(), nBytes, Response::VOLATILE, Response::OK); 207 #else 208 if (write(fdOut, oss.str().c_str(), nBytes) < 0) { 209 ERROR("write failed: %s", strerror(errno)); 210 return -1; 211 } 212 #endif 213 return 0; 214 } 201 215 202 216 int … … 455 469 } else { 456 470 TRACE("No render required"); 471 sendAck((ClientData)clientData, g_fdOut); 457 472 } 458 473 -
trunk/packages/vizservers/vtkvis/RpVtkRenderServer.h
r3410 r3451 25 25 #ifndef STATSDIR 26 26 #define STATSDIR "/var/tmp/visservers" 27 #endif 27 #endif 28 28 29 29 typedef struct { -
trunk/packages/vizservers/vtkvis/RpVtkRenderer.cpp
r3419 r3451 4336 4336 * \brief Get nearest data value given display coordinates x,y 4337 4337 * 4338 * FIXME: This doesn't work when actors are scaled 4339 * 4338 4340 * Note: no interpolation is performed on data 4339 4341 */ -
trunk/packages/vizservers/vtkvis/RpVtkRendererCmd.cpp
r3423 r3451 37 37 38 38 #ifdef USE_THREADS 39 static void 40 QueueResponse(ClientData clientData, const void *bytes, size_t len, 41 Response::AllocationType allocType, 42 Response::ResponseType type = Response::DATA) 39 void 40 Rappture::VtkVis::queueResponse(ClientData clientData, 41 const void *bytes, size_t len, 42 Response::AllocationType allocType, 43 Response::ResponseType type) 43 44 { 44 45 ResponseQueue *queue = (ResponseQueue *)clientData; … … 1935 1936 1936 1937 #ifdef USE_THREADS 1937 QueueResponse(clientData, buf, strlen(buf), Response::VOLATILE);1938 queueResponse(clientData, buf, strlen(buf), Response::VOLATILE); 1938 1939 #else 1939 1940 ssize_t bytesWritten = SocketWrite(buf, strlen(buf)); … … 4162 4163 4163 4164 #ifdef USE_THREADS 4164 QueueResponse(clientData, buf, length, Response::VOLATILE);4165 queueResponse(clientData, buf, length, Response::VOLATILE); 4165 4166 #else 4166 4167 ssize_t bytesWritten = SocketWrite(buf, length); … … 4198 4199 4199 4200 #ifdef USE_THREADS 4200 QueueResponse(clientData, buf, length, Response::VOLATILE);4201 queueResponse(clientData, buf, length, Response::VOLATILE); 4201 4202 #else 4202 4203 ssize_t bytesWritten = SocketWrite(buf, length); … … 4252 4253 4253 4254 #ifdef USE_THREADS 4254 QueueResponse(clientData, buf, length, Response::VOLATILE);4255 queueResponse(clientData, buf, length, Response::VOLATILE); 4255 4256 #else 4256 4257 ssize_t bytesWritten = SocketWrite(buf, length); … … 4287 4288 value[0], value[1], value[2], name); 4288 4289 #ifdef USE_THREADS 4289 QueueResponse(clientData, buf, length, Response::VOLATILE);4290 queueResponse(clientData, buf, length, Response::VOLATILE); 4290 4291 #else 4291 4292 ssize_t bytesWritten = SocketWrite(buf, length); … … 4398 4399 len += 2; 4399 4400 #ifdef USE_THREADS 4400 QueueResponse(clientData, oss.str().c_str(), len, Response::VOLATILE);4401 queueResponse(clientData, oss.str().c_str(), len, Response::VOLATILE); 4401 4402 #else 4402 4403 ssize_t bytesWritten = SocketWrite(oss.str().c_str(), len); … … 9789 9790 9790 9791 #ifdef USE_THREADS 9791 QueueResponse(clientData, oss.str().c_str(), nBytes, Response::VOLATILE, Response::ERROR);9792 queueResponse(clientData, oss.str().c_str(), nBytes, Response::VOLATILE, Response::ERROR); 9792 9793 #else 9793 9794 if (write(fdOut, oss.str().c_str(), nBytes) < 0) { … … 9814 9815 9815 9816 #ifdef USE_THREADS 9816 QueueResponse(clientData, oss.str().c_str(), nBytes, Response::VOLATILE, Response::ERROR);9817 queueResponse(clientData, oss.str().c_str(), nBytes, Response::VOLATILE, Response::ERROR); 9817 9818 #else 9818 9819 if (write(fdOut, oss.str().c_str(), nBytes) < 0) { -
trunk/packages/vizservers/vtkvis/RpVtkRendererCmd.h
r3360 r3451 13 13 14 14 #include "ReadBuffer.h" 15 #ifdef USE_THREADS 16 #include "ResponseQueue.h" 17 #endif 15 18 16 19 namespace Rappture { 17 20 namespace VtkVis { 21 22 #ifdef USE_THREADS 23 extern void queueResponse(ClientData clientData, const void *bytes, size_t len, 24 Response::AllocationType allocType, 25 Response::ResponseType type = Response::DATA); 26 #endif 18 27 19 28 extern int processCommands(Tcl_Interp *interp,
Note: See TracChangeset
for help on using the changeset viewer.