d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Piping In Unix
Prev12
Add Reply New Topic New Poll
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Jan 29 2013 08:34pm
Quote (Eep @ Jan 29 2013 10:14pm)
wow..

I just read up a bit about sockets the other day (not for class, for fun).....I also read a little win32 tut on how to create a simple BLOCKING socket? in c++.

I am pretty interested in network comm. and how that all works.

The code here http://www.win32developer.com/tutorial/winsock/winsocktutorial1.shtm

seems relatively light, but I feel there is a lot more to it probably?

Also curious as to how sockets work when you modularize programs....what file do you put that sort of stuff in lol? Or would it belong to a class? Beats me ><


theres really nothing else to sockets then that. the rest of it is pretty much how you interact with them.

you can most likely take one of your earlier projects you made and pit all the `cin` inputs in the client but instead of using `cin` use send() and on server replace `cout` with send() (after using recv to get the data of course).

pretty much lets use the libaray booking program most people have to do.

normal program flow:

app) enter book id
app) searches file for book id
app) spits out errors or messages

client server model

client) enter a book code to search for ( send()'s it to the server)
server) recv()'s the code and searches for it (lets assume we store this in a file, server gets the id searches for the book code)
server) sends()'s weither the book is in stock or an error
client) recv()'s the message
client) asks user for another code to send

basically once the sockets are connected (basically what the tutorial shows you how to do) you do w/e you would do with files but remotely. just think of the roles of what the server would do and what the client will do and start coding.

This post was edited by AbDuCt on Jan 29 2013 08:37pm
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Jan 29 2013 08:38pm
wow that is pretty neat

I assume at the low level that these functions are somehow accessing internet ports etc on the computer.

This post was edited by Eep on Jan 29 2013 08:38pm
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Jan 29 2013 08:43pm
Quote (Eep @ Jan 29 2013 10:38pm)
wow that is pretty neat

I assume at the low level that these functions are somehow accessing internet ports etc on the computer.


yea but thats close to hardware/kernel level your talking about. you wont need to know about that like ever. even in asm all the functions are the same as in C (actually asm uses the same kernal system calls that C does so its almost exactly the same) except that you have to do it asm format.
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Jan 29 2013 08:54pm
Quote (AbDuCt @ Jan 29 2013 09:43pm)
yea but thats close to hardware/kernel level your talking about. you wont need to know about that like ever. even in asm all the functions are the same as in C (actually asm uses the same kernal system calls that C does so its almost exactly the same) except that you have to do it asm format.


really? never knew that about asm. I still kind of want to learn it, we kind of talked about registers today in our architecture class when describing logic circuits (mostly stuff I already knew, cept about half adders/full adders o.o) and asm seems to make a lot of sense to me.

but yeah on a side note I kinda farked myself over.

I was going to take this web languages class this semester but it was full so I signed up for a bunch of others. Well they opened up another section pretty late but I was happy with what I had.

I forgot to check the requirements for alot of the 4000 level classes (senior level)

all the ones that didn't sound too bad which I was going to take in the fall all have web languages as a pre req >< (like advanced java programming and object oriented analysis and the class simply titled "programming languages"...)

I hope I didn't screw myself in the long run now ><

This post was edited by Eep on Jan 29 2013 08:55pm
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll