Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Izaya

ocsocket

Recommended Posts

Before implimenting higher-level protocols, you'll want a lower-level way to make your messages appear as a stream, just like TCP sockets, right?

That's where this comes in.

ocsocket makes modems behave like TCP sockets.

Functions:

ocsocket.socket(port,address)

That will return a socket object.

Socket object functions:

obj.init()

Must be called to make a socket work.

octcp.isData()

Returns true if there is data to be read, false otherwise.

obj.read(i)

i is a number or character, if it's a number, it will read that many characters. If it's a string, it will read until that character appears.

obj.write(string)

Sends string to the target computer

obj.close()

Closes the socket and stops listening.

 

And the download?

http://pastebin.com/vyW5k820

Alternatively:

pastebin get vyW5k820 ocsocket

I reccomend you place it in /usr/lib

That is all.

Bai o/

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.