Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 3675x 3675x 3675x 3675x 3675x 3675x 3675x 41x 41x 41x 41x 41x 155x 155x 155x 155x 41x 41x 41x 41x 41x 9486x 9486x 41x 41x 41x 41x 41x 4110x 4110x 41x 41x 41x 41x 41x 2075x 2075x 41x 41x 5779x 5779x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 9328x 9328x 9328x 9328x 9328x 9328x 9328x 9328x 41x 41x 1155x 1155x 1155x 1155x 1155x 1155x 1155x 1155x 1155x 1155x 1155x 1155x 1155x 1155x 1155x 1155x 1155x 1155x 1155x 1155x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1155x 1155x 41x 41x 1995x 1995x 1995x 1995x 1995x 1995x 1995x 2x 1995x 1993x 1995x 1993x 1995x 1993x 1995x 2x 2x 1991x 1991x 1995x 41x 41x 335x 335x 41x 41x 41x 41x 41x 241x 241x 41x 41x 155x 155x 155x 41x 41x 163x 163x 163x 148x 162x 163x 163x 163x 163x 160x 160x 160x 162x 163x 41x 41x 446x 446x 446x 41x 41x 178x 15x 15x 15x 178x 153x 153x 153x 153x 153x 153x 153x 163x 3x 3x 3x 10x 7x 7x 171x 178x 41x | // Copyright (c) ZeroC, Inc. import { Address } from "./Address.js"; import { ParseException } from "./LocalExceptions.js"; import { HashUtil } from "./HashUtil.js"; import { StringUtil } from "./StringUtil.js"; import { EndpointI } from "./EndpointI.js"; export class IPEndpointI extends EndpointI { constructor(instance, host, port, sourceAddress, connectionId) { super(); this._instance = instance; this._host = host === undefined ? null : host; this._port = port === undefined ? 0 : port; this._sourceAddr = sourceAddress === undefined ? null : sourceAddress; this._connectionId = connectionId === undefined ? "" : connectionId; } // // Marshal the endpoint // streamWrite(s) { s.startEncapsulation(); this.streamWriteImpl(s); s.endEncapsulation(); } // // Return the endpoint type // type() { return this._instance.type(); } // // Return the protocol string // protocol() { return this._instance.protocol(); } // // Return true if the endpoint is secure. // secure() { return this._instance.secure(); } connectionId() { return this._connectionId; } // // Return a new endpoint with a different connection id. // changeConnectionId(connectionId) { if (connectionId === this._connectionId) { return this; } else { return this.createEndpoint(this._host, this._port, connectionId); } } // // Return the endpoint information. // hashCode() { let h = 5381; h = HashUtil.addNumber(h, this.type()); h = HashUtil.addString(h, this._host); h = HashUtil.addNumber(h, this._port); h = HashUtil.addString(h, this._sourceAddr); h = HashUtil.addString(h, this._connectionId); return h; } options() { // // WARNING: Certain features, such as proxy validation in Glacier2, // depend on the format of proxy strings. Changes to toString() and // methods called to generate parts of the reference string could break // these features. Please review for all features that depend on the // format of proxyToString() before changing this and related code. // let s = ""; if (this._host !== null && this._host.length > 0) { s += " -h "; const addQuote = this._host.indexOf(":") != -1; if (addQuote) { s += '"'; } s += this._host; if (addQuote) { s += '"'; } } s += " -p " + this._port; if (this._sourceAddr !== null && this._sourceAddr.length > 0) { s += " --sourceAddress "; const addQuote = this._sourceAddr.indexOf(":") != -1; if (addQuote) { s += '"'; } s += this._sourceAddr; if (addQuote) { s += '"'; } } return s; } compareTo(p) { if (this === p) { return 0; } if (p === null) { return 1; } if (!(p instanceof IPEndpointI)) { return this.type() < p.type() ? -1 : 1; } if (this._port < p._port) { return -1; } else if (p._port < this._port) { return 1; } if (this._host != p._host) { return this._host < p._host ? -1 : 1; } if (this._sourceAddr != p._sourceAddr) { return this._sourceAddr < p._sourceAddr ? -1 : 1; } if (this._connectionId != p._connectionId) { return this._connectionId < p._connectionId ? -1 : 1; } return 0; } getAddress() { return new Address(this._host, this._port); } // // Convert the endpoint to its Connector string form // toConnectorString() { return this._host + ":" + this._port; } streamWriteImpl(s) { s.writeString(this._host); s.writeInt(this._port); } initWithOptions(args, oaEndpoint) { super.initWithOptions(args); if (this._host === null || this._host.length === 0) { this._host = this._instance.defaultHost(); } else if (this._host == "*") { if (oaEndpoint) { this._host = ""; } else { throw new ParseException(`'-h *' not valid for proxy endpoint '${this}'`); } } if (this._host === null) { this._host = ""; } if (this._sourceAddr === null) { if (!oaEndpoint) { this._sourceAddr = this._instance.defaultSourceAddress(); } } else if (oaEndpoint) { throw new ParseException(`--sourceAddress not valid for object adapter endpoint '${this}'`); } } initWithStream(s) { this._host = s.readString(); this._port = s.readInt(); } checkOption(option, argument, str) { if (option === "-h") { if (argument === null) { throw new ParseException(`no argument provided for -h option in endpoint ${str}`); } this._host = argument; } else if (option === "-p") { if (argument === null) { throw new ParseException(`no argument provided for -p option in endpoint ${str}`); } try { this._port = StringUtil.toInt32(argument); } catch { throw new ParseException(`invalid port value '${argument}' in endpoint ${str}`); } if (this._port < 0 || this._port > 65535) { throw new ParseException(`port value '${argument}' out of range in endpoint ${str}`); } } else if (option === "--sourceAddress") { if (argument === null) { throw new ParseException(`no argument provided for --sourceAddress option in endpoint ${str}`); } this._sourceAddr = argument; } else { return false; } return true; } } |