Skip to content

Instantly share code, notes, and snippets.

View seankerr's full-sized avatar

Sean Kerr seankerr

  • CartHero & AppTrends
  • San Diego
View GitHub Profile
pub fn query_string<'a>(display: EGLDisplay, name: EGLint) -> &'a CStr {
unsafe {
let c_str = ffi::eglQueryString(display, name);
if !c_str.is_null() {
CStr::from_ptr(c_str)
} else {
panic!("Could not query string".to_string())
}
}
-module(chat_server).
-export([start/1]).
handle_socket(Router, Client) ->
case gen_tcp:recv(Client, 0) of
{ok, Data} ->
case string:str(binary_to_list(Data), "!quit") of
1 ->
Router ! {delete, Client},