MCPcopy
hub / github.com/tinode/chat / init_client

Function init_client

chatbot/python/chatbot.py:232–250  ·  view source on GitHub ↗
(addr, schema, secret, cookie_file_name, secure, ssl_host)

Source from the content-addressed store, hash-verified

230 return server
231
232def init_client(addr, schema, secret, cookie_file_name, secure, ssl_host):
233 log("Connecting to", "secure" if secure else "", "server at", addr,
234 "SNI="+ssl_host if ssl_host else "")
235
236 channel = None
237 if secure:
238 opts = (('grpc.ssl_target_name_override', ssl_host),) if ssl_host else None
239 channel = grpc.secure_channel(addr, grpc.ssl_channel_credentials(), opts)
240 else:
241 channel = grpc.insecure_channel(addr)
242
243 # Call the server
244 stream = pbx.NodeStub(channel).MessageLoop(client_generate())
245
246 # Session initialization sequence: {hi}, {login}, {sub topic='me'}
247 client_post(hello())
248 client_post(login(cookie_file_name, schema, secret))
249
250 return stream
251
252def client_message_loop(stream):
253 try:

Callers 1

runFunction · 0.85

Calls 6

logFunction · 0.85
client_generateFunction · 0.85
client_postFunction · 0.85
helloFunction · 0.85
loginFunction · 0.85
MessageLoopMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…