Skip to content

Instantly share code, notes, and snippets.

@cdrubin
Created April 22, 2010 01:47
Show Gist options
  • Save cdrubin/374703 to your computer and use it in GitHub Desktop.
Save cdrubin/374703 to your computer and use it in GitHub Desktop.
// in the C header :
struct Skt_str {
int skt; /* skt handle */
SKTEVENT port; /* associated port */
int type; /* PM_SERVER, PM_CLIENT, PM_ACCEPT */
char *sktname; /* name of socket */
char *hostname; /* name of host */
};
// in my cover code :
Socket: cover from struct Skt_str {
skt: extern Int /* skt handle */
port: extern UShort /* associated port */
type: extern Int /* PM_SERVER, PM_CLIENT, PM_ACCEPT */
sktname: extern String /* name of socket */
hostname: extern String /* name of host */
}
// and in the code I am using :
ResponseHandler: class extends Runnable {
skt: Socket*
run: func {
( "From: " + skt hostname ) println()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment