Changeset 3824


Ignore:
Timestamp:
03/14/08 17:37:57 (12 years ago)
Author:
curtis
Message:
  • Fix server shutdown race condition.
  • Turn off verbose debug output on the client side.
Location:
trunk/loci/jvmlink
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/jvmlink/ConnThread.java

    r3823 r3824  
    135135   *   1-9 - int, string, byte, char, float, bool, double, long, short 
    136136   *     (in order) 
    137    * 
    138    * Then: 
    139    *  size - number of bytes (per item) 
    140    *   In case of strings, length of string 
    141    *   For array of strings, 0 
    142137   */ 
    143138 
  • trunk/loci/jvmlink/cpp/JVMLinkClient.cpp

    r3823 r3824  
    8181        debug("Socket created"); 
    8282 
    83         if (inet_addr(servername)==INADDR_NONE) 
    84         { 
     83        if (inet_addr(servername)==INADDR_NONE) { 
    8584                hp=gethostbyname(servername); 
    8685        } 
    87         else 
    88         { 
     86        else { 
    8987                addr=inet_addr(servername); 
    9088                hp=gethostbyaddr((char*)&addr,sizeof(addr),AF_INET); 
    9189        } 
    92         if (hp == NULL) 
    93         { 
     90        if (hp == NULL) { 
    9491                closesocket(conn); 
    9592                debug("Could not resolve network address: " << servername); 
     
    10198        server.sin_family=AF_INET; 
    10299        server.sin_port=htons(port); 
    103         if (connect(conn,(struct sockaddr*)&server,sizeof(server))) 
    104         { 
     100        if (connect(conn,(struct sockaddr*)&server,sizeof(server))) { 
    105101                closesocket(conn); 
    106102                debug("No server response on port " << port); 
     
    113109int JVMLinkClient::closeConnection() { 
    114110        debug("Closing connection"); 
     111        shutdown(conn, SD_SEND); 
    115112        closesocket(conn); 
    116113        debug("Socket closed"); 
    117114        WSACleanup(); 
    118115        debug("De-initialized WinSock"); 
    119         return 0; 
     116        return CONNECTION_SUCCESS; 
    120117} 
    121118 
  • trunk/loci/jvmlink/cpp/JVMLinkClient.h

    r3766 r3824  
    3535 
    3636// NB: Toggle comments to control debugging output for the client. 
    37 //#define debug(msg) ((void)0) 
    38 #define debug(msg) std::cout << "JVMLinkClient: " << msg << std::endl 
     37#define debug(msg) ((void)0) 
     38//#define debug(msg) std::cout << "JVMLinkClient: " << msg << std::endl 
    3939 
    4040class JVMLinkClient 
  • trunk/loci/jvmlink/cpp/JVMLinkObject.h

    r3823 r3824  
    3232 
    3333#pragma once 
    34  
    35 class JVMLinkClient; 
    3634 
    3735enum Command { 
Note: See TracChangeset for help on using the changeset viewer.