Teen Programmers Unite  
 

 

Return to forum top

Sockets

Posted by putang1080 [send private reply] at July 10, 2001, 10:06:23 PM

I am designing a peer to peer program where, of course, u can search and d/n files from other computers. i need help with sockets. at first i want to make a chatroom just to fart around with m friends. neway, i can't find any good sites for programming winsock in win32 applications. i found code for dos chat programs, but i really want a win32 chat program. please help me!!!

Posted by taubz [send private reply] at July 11, 2001, 04:00:35 PM

I can shed some light in some specific areas of that. I've never actually done that in C, but I have in Java and VB. :)

From what I know in Java, I can tell you about using blocking sockets. The basic premis is you initialize the Winsock library, open a connection to some remote host (perhaps get the IP first), and then pool the socket for information in something like a do loop. Multithreading is very helpful for that, so you can send information from another thread based on user input. When you're done, you close the connection and unload the Winsock library.

You can find the actual function calls in the MS PSDK, or search msdn.microsoft.com/library.

I can help you with more specifics if you have specific questions.

- taubz

Posted by putang1080 [send private reply] at July 12, 2001, 03:21:38 PM

i need some code!!!

Posted by grandsnafu [send private reply] at July 12, 2001, 05:30:41 PM

You are lazy, huh? Try these, maybe they'll help (I haven't looked at them, so I'm not sure how useful they'll be):
www.cyberport.com/~tangent/programming/winsock/
www.sockets.com/

If these still don't help, go to google and try "Open source win32 chat program" or something. Even better, try sourcefourge.net. They have tons of open source chat programs for all different OSi (the new plural for OS) If that still doesn't work, do it all from scratch.

Posted by putang1080 [send private reply] at July 19, 2001, 11:08:51 AM

i'm not lazy, but i just like to see other code to get ideas from.

Posted by grandsnafu [send private reply] at July 19, 2001, 03:56:19 PM

Sorry. I'm lazy, and forgot that not everyone else was :-)

Posted by gian [send private reply] at July 20, 2001, 01:48:43 AM

I'm lazy, but Psion reminds me on a daily basis that I AM the only one. :-(

Posted by putang1080 [send private reply] at July 22, 2001, 10:37:06 AM

ok, so maybe i am a little lazy, but not when it comes to programming:)

Posted by AngelOD [send private reply] at July 22, 2001, 12:51:49 PM

There are several pages that you could look at.. First of all, you could look at http://www.planet-source-code.com and under the C/C++ realm you could try finding it (assuming it's C/C++ you're using).

Or even better, read "Beej's Guide to Network Programming" that explains it better than any other tutorial/guide I've ever seen.. Find it at http://www.ecst.csuchico.edu/~beej/guide/net/
It's written for UNIX-based systems, but informs you how to change the code for use with Windows. :o)

Well, hope this helps.

Posted by ronybc [send private reply] at August 04, 2001, 11:15:50 AM

http://www.geocities.com/sparc32

Telnet server using MASM..
A simple Winsock code.. open your CDROM drive from anywhere in the world.

You must be logged in to post messages and see which you have already read.

Log on
Username:
Password:
Save for later automatic logon

Register as a new user
 
Copyright TPU 2002. See the Credits and About TPU for more information.