Thread: RPC instead of Winsock

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    10

    RPC instead of Winsock

    So apparently the teacher doesn't like winsock, says we must use RPC to do network communication on a Windows machine... seems that doing RPC-XML on Linux is easy enough, but I'm finding it nearly impossible to find RPC libraries that aren't 40 miles long...

    Mind you, this is a beginners C programming class...

    He was also earlier claiming that RPC allows you to do communication without ports... Seems impossible being as TCP/IP packets are constructed with port data...

    Looking for a way to send and receive simple bits of text, had it working fine on Winsock, but says that because he used RPC "some time ago, but forgot how to do it" that we can do it.



    Of course, I can't tell why he expects us to use RPC, it seems counter-productive to the problem, and it's something he can't even confirm exists for Windows.
    Last edited by StrangeWill; 11-26-2007 at 08:35 PM.

  2. #2
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Is is just me or do people totally forget to actually ask a question these days?

    One could mistakenly assume that you simply came here to moan.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    10
    Well even though "RPC instead of Winsock" isn't really a question, I was looking for an alternative method being as my teacher claimed we could use RPC intead of Winsock... it seems all RPC like methods use Winsock on windows... I wanted people's opinion whither or not there are bare RPC libraries, or my teacher is wasting our time on a wild goose chase that we'll never find.

    Question form:

    Where can I get an RPC library for Windows that is simple like Winsock (actually teacher claims its way more simple than winsock)?

  4. #4
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    I think he means using RPC instead of manually using Winsock since any Windows RPC facility is most likely built off of Winsock.

    RPC isn't as bad as you might think, though.

  5. #5
    Registered User
    Join Date
    Nov 2007
    Posts
    10
    Quote Originally Posted by MacGyver View Post
    RPC isn't as bad as you might think, though.
    Thats what I thought too, however finding RPC for Windows seems to be difficult, there is SOAP that we're looking into, but I don't really get how thats much different from Winsock, then again we haven't gotten far into it, and as I understand it, constructing winsock to take arguments to determine which functions to call is basically RPC, correct?

    Quote Originally Posted by MacGyver View Post
    I think he means using RPC instead of manually using Winsock since any Windows RPC facility is most likely built off of Winsock.
    He was wanting us to throw out the Winsock code I got working and "use RPC instead of Winsock". Really confused being as I understood it, RPC is a programming method, not a replacement for network communication. We ended up blowing an entire day of class (5 hours, one day a week) looking up libraries for RPC, until I explained that I couldn't find an implementation that didn't involve Winsock in a more complicated fashion (usually used for application distribution, or some way-over what we need thing), and that we weren't going to find strictly RPC network communication libraries. That it's a method of communication, not a communication structure.

    His direct words were "you don't need ports" and "you don't need winsock, there are easier ways". I have yet to find either.


    Is going the way of SOAP better? Or should I construct some overlay on Winsock so it acts with an RPC like behavior? By the end of class he seemed to accept the idea of writing an overlay for Winsock being as none of us were finding anything.
    Last edited by StrangeWill; 11-27-2007 at 02:44 AM.

  6. #6
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Didn't he give any examples or mention anything?

    Try reading up on MSDN: http://msdn2.microsoft.com/en-us/library/aa373570.aspx

  7. #7
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    There's RPC the protocol and there's RPC the concept.

    There are a couple of RPC protocols defined. None of them are tied to any particular transport, but TCP is a common transports which is used. On Windows, that means Winsock is used. Using the Windows RPC library seems *way* out of scope for a "beginners C programming class".

    >> Is going the way of SOAP better?
    Not for a beginners C programming project on Windows.

    >> he seemed to accept the idea of writing an overlay for Winsock
    Since you've already written code to send messages you're just about finished. Send a text message containing a function to call and it's parameters. The reply text message would contain the return value. Nothing fancy, but it's RPC (the concept).

    gg

  8. #8
    Registered User
    Join Date
    Nov 2007
    Posts
    10
    Quote Originally Posted by MacGyver View Post
    Didn't he give any examples or mention anything?

    Try reading up on MSDN: http://msdn2.microsoft.com/en-us/library/aa373570.aspx
    No, thats what really kind of bugs me, he's giving us vague references to things he's claimed to do, that frankly my last computer classes have said are impossible without writing your own drivers for the operating system and constructing your own packet system (oh and re-writing switches and routers), and that he can't recall any specifics, but that it was somehow easier.

    The fact that our class has 150 combined hours and have come up with nothing that he describes and wanted us to use until we told him there was simply nothing like what he's telling us about, and that I was guessing our best bet was to use Winsock to write our own RPC system.

    His exact words contained these key phrases:
    "What if I block all ports? With Winsock you have to use ports, with RPC I didn't."
    "It is much simpler than this (talking about my possibly 3-4 pages of winsock code)"
    But when we ask how, or what libraries, or if he could remember any slightest detail that may help us track it down, he would shrug and say it was our job to research it. It's one thing for us to learn, it's another to give us some imaginary idea to chase after for two critical class periods.

    Quote Originally Posted by Codeplug View Post
    There's RPC the protocol and there's RPC the concept.

    There are a couple of RPC protocols defined. None of them are tied to any particular transport, but TCP is a common transports which is used. On Windows, that means Winsock is used. Using the Windows RPC library seems *way* out of scope for a "beginners C programming class".

    >> Is going the way of SOAP better?
    Not for a beginners C programming project on Windows.

    >> he seemed to accept the idea of writing an overlay for Winsock
    Since you've already written code to send messages you're just about finished. Send a text message containing a function to call and it's parameters. The reply text message would contain the return value. Nothing fancy, but it's RPC (the concept).

    gg
    Yeah, a few students haven't even touched a language before this class, thats how new some of us are.

    Basically as I understand it, Winsock can only transfer character values, so we're serializing a struct that contains function and parameter data, and passing that as a character string. It would be nice to be able to just send the byte data of the struct to be honest, but I dunno if thats possible.
    Last edited by StrangeWill; 11-28-2007 at 04:29 AM.

  9. #9
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Quote Originally Posted by StrangeWill View Post
    "What if I block all ports? With Winsock you have to use ports, with RPC I didn't."
    I nominate this quote for some sort of award.

    Oh, yeah.... Get a refund for this course.

  10. #10
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    He may be confusing RPC with IPC. You can have Inter-Process Communication without "using ports". But any type of IPC that doesn't "use ports" implies that the two processes which are communicating are on the same box.

    gg

  11. #11
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Codeplug View Post
    He may be confusing RPC with IPC. You can have Inter-Process Communication without "using ports". But any type of IPC that doesn't "use ports" implies that the two processes which are communicating are on the same box.

    gg
    Or at the very least that you don't use "Internet Protocol" for the communication - if you use for example a plain serial port to send/receive commands, you don't use ports in the internelt protocol sense [you are of course using a serial port, but that's a physical connection, not an IP port].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  12. #12
    Registered User
    Join Date
    Nov 2007
    Posts
    10
    Okay, I did as suggested and wrote my own simple overlay over winsock that allows us to send structs which contain enough data to run it RPC like.

    Thanks for the suggestions guys, and reassurance of not chasing this invisible library for the last two weeks of class and coming up empty handed.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Winsock issues
    By tjpanda in forum Windows Programming
    Replies: 3
    Last Post: 12-04-2008, 08:32 AM
  2. Winsock Messaging Program
    By Morgul in forum Windows Programming
    Replies: 13
    Last Post: 04-25-2005, 04:00 PM
  3. Where do I initialize Winsock and catch messages for it?
    By Lithorien in forum Windows Programming
    Replies: 10
    Last Post: 12-30-2004, 12:11 PM
  4. winsock
    By pode in forum Networking/Device Communication
    Replies: 2
    Last Post: 09-26-2003, 12:45 AM
  5. Determining Data Size For Network Send/Rec :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 6
    Last Post: 05-07-2002, 09:01 PM