-lock_client::lock_client(string xdst, class lock_release_user *_lu) : lu(_lu), next_xid(0) {
- cl = new rpcc(xdst);
- if (cl->bind() < 0)
- LOG("lock_client: call bind");
-
- srandom((uint32_t)time(NULL)^last_port);
- rlock_port = ((random()%32000) | (0x1 << 10));
- id = "127.0.0.1:" + to_string(rlock_port);
- last_port = rlock_port;
- rpcs *rlsrpc = new rpcs(rlock_port);
+lock_client::lock_client(string xdst, lock_release_user *_lu) : lu(_lu), next_xid(0) {
+ rlock_port = std::uniform_int_distribution<in_port_t>(1024,32000+1024)(global->random_generator);
+ id = "127.0.0.1:" + std::to_string(rlock_port);
+ rlsrpc = std::make_unique<rpcs>(rlock_port);