# jBASE Sockets

Updated: 10/19/2020, 10:24:56 AM
Created: 10/19/2020, 10:24:56 AM
Last Updated By: Daniel Klein
Read Time: 1 minute(s)

jBASE offers some internal functions to gain access to Sockets.  jBASE socket functions are built in C based functions and can be accessed by using DEFC and importing the functions.

  • DEFC VAR SOCKOPEN(handle, ip, port, timeout, setting)
  • DEFC VAR SOCKCLOSE(handle, setting)
  • DEFC VAR SOCKSEND(client_handle, data_to_send, setting)
  • DEFC VAR SOCKRECV(client_handle, recieve_message, setting)
  • DEFC VAR SOCKSERV(port, server_handle, conDetails)
  • DEFC VAR SOCKACCEPT(server_handle, client_handle_number, setting)
  • DEFC VAR SOCKBIND(server_handle, client_handle_number, client_handle, setting)
  • DEFC VAR GETSOCKBASE(server_handle)
  • DEFC VAR GETSERVERHANDLE(server_handle, ctx)

Here is a github project with a good example on how to create both a socket client and server.

https://github.com/zumasys/jbase_sockets

Back to Coding Corner