Source

crossroads / crossroads / low.py

Diff from to

File crossroads/low.py

 
 from . import lowest as xs
 from . import constants as XS
-from .message import MessageXS, Message
+from .message import RecvMsg, RecvMsg32, SendMsg, SendMsg32
 
 bigxsget = partial(getattr, XS)
 xsget = partial(getattr, xs)
         return unique_id()
 
     def send(self, data, size=None, more=False, nowait=False):
-        msg = Message(size, data)
+        msg = SendMsg(size, data)
         msg.last_rc = self.last_rc = self._send(
-            msg.src,
-            len(msg),
+            msg.msg,
+            msg.size,
             XS.DONTWAIT if nowait else 0 | XS.SNDMORE if more else 0,
         )
         return msg
 
     def sendmsg(self, data, more=False, nowait=False):
-        msg = MessageXS(data)
-        src = msg.src
+        msg = SendMsg32(data)
         msg.last_rc = self.last_rc = self._sendmsg(
-            src, XS.DONTWAIT if nowait else 0 | XS.SNDMORE if more else 0,
+            msg.msg, XS.DONTWAIT if nowait else 0 | XS.SNDMORE if more else 0,
         )
         return msg
 
     def recv(self, size, nowait=False, char=False):
-        msg = Message(size, char=char)
+        msg = RecvMsg(size, char)
         msg.last_rc = self.last_rc = self._recv(
-            msg.dest, msg.size, XS.DONTWAIT if nowait else 0,
+            msg.msg, msg.size, XS.DONTWAIT if nowait else 0,
         )
         msg.more = self.rcvmore
         return msg
 
     def recvmsg(self, nowait=False):
-        msg = MessageXS()
+        msg = RecvMsg32()
         msg.last_rc = self.last_rc = self._recvmsg(
-            msg.dest, XS.DONTWAIT if nowait else 0,
+            msg.msg, XS.DONTWAIT if nowait else 0,
         )
         msg.more = self.rcvmore
         return msg