Lines Matching refs:desc
145 CoreConnection* desc;
146 ANEW0(desc);
147 desc->console_address = console_address[0];
148 desc->ssocket = NULL;
149 desc->stream_name = NULL;
151 return desc;
155 core_connection_free(CoreConnection* desc)
157 if (desc == NULL) {
160 if (desc->ssocket != NULL) {
161 syncsocket_free(desc->ssocket);
163 if (desc->stream_name != NULL) {
164 free(desc->stream_name);
166 free(desc);
170 core_connection_open(CoreConnection* desc)
172 if (desc == NULL) {
176 if (desc->ssocket != NULL) {
180 desc->ssocket = core_connection_open_socket(&desc->console_address);
182 return (desc->ssocket != NULL) ? 0 : -1;
186 core_connection_close(CoreConnection* desc)
188 if (desc == NULL) {
191 if (desc->ssocket != NULL) {
192 syncsocket_close(desc->ssocket);
197 core_connection_write(CoreConnection* desc,
204 int status = syncsocket_start_write(desc->ssocket);
211 syncsocket_write(desc->ssocket, buffer, to_write, CORE_PORT_TIMEOUT_MS);
212 syncsocket_stop_write(desc->ssocket);
225 core_connection_read(CoreConnection* desc,
232 int status = syncsocket_start_read(desc->ssocket);
239 syncsocket_read(desc->ssocket, buffer, to_read, CORE_PORT_TIMEOUT_MS);
240 syncsocket_stop_read(desc->ssocket);
253 core_connection_switch_stream(CoreConnection* desc,
263 if (desc == NULL || desc->stream_name != NULL || stream_name == NULL) {
270 if (core_connection_write(desc, buf, strlen(buf), NULL)) {
275 status = syncsocket_start_read(desc->ssocket);
281 syncsocket_read_line_absolute(desc->ssocket, buf, sizeof(buf), deadline);
296 desc->stream_name = strdup(stream_name);
298 status = syncsocket_read_line_absolute(desc->ssocket, buf, sizeof(buf),
300 syncsocket_stop_read(desc->ssocket);
312 syncsocket_stop_read(desc->ssocket);
318 syncsocket_stop_read(desc->ssocket);
354 core_connection_detach(CoreConnection* desc)
356 core_connection_write(desc, "\n", 1, NULL);
360 core_connection_get_socket(CoreConnection* desc)
362 return (desc != NULL) ? syncsocket_get_socket(desc->ssocket) : -1;