Permalink
Browse files

Added base class

  • Loading branch information...
1 parent fffabbd commit 80b369a8b7d99ead39bfca9f46eeaaf06442b51c @aallai committed Nov 23, 2011
Showing with 36 additions and 0 deletions.
  1. +36 −0 Medium.py
View
@@ -0,0 +1,36 @@
+
+# base class for transmission medium
+# just a draft for now
+
+Class Medium :
+
+ '''Base class for transmission medium.'''
+
+ def send(user, data, mid, seq) :
+
+ '''
+ I am thinking of this sending one message (i.e a single email or tweet or whatever),
+ I am not sure what user will be yet, maybe just an adress (this might limit the mediums
+ we can use), maybe an object of some sort containing medium specific info about the user.
+
+ user -> ???
+ mid -> message id
+ seq -> sequence number
+ data -> string to send
+ '''
+
+
+ def receive(user, mid) :
+
+ '''
+ Again, not sure what user will be, mid is the message id.
+ '''
+
+
+ def mtu() :
+
+ '''
+ Something to get the medium's mtu, for example you can only send a limited amount of
+ characters in a tweet.
+ '''
+

0 comments on commit 80b369a

Please sign in to comment.