🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

BeOS + TCP + C = ?

Started by
5 comments, last by Muzzafarath 23 years, 9 months ago
I thought I''d try programming some simple client/server programs in BeOS. I have never done any network programming in C, so bear with me I thought I''d try something really basic: a server that simply waits for a connection and when someone connects it should simply print out a message saying that someone connected and then exit. Now this isn''t working out very good (when I try to connect with my client, connect() returns B_ERROR). I''d be very grateful if anyone who has any experience with BSD-style sockets (or network programming of any kind) could take a look at the source and tell me what I did wrong. Let me know and I''ll e-mail you the source, or if you want me to, I''ll post it here.
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Advertisement
BeOS + TCP + C = BeOSTCPC
Haha, that''s really funny Anon...
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Well, I sent you an email but you didn''t reply to it so I guess you didn''t need any help afterall...
-------------------------------------------------------------LGPL 3D engine - http://www.sourceforge.net/projects/realityengine
Oh yes I saw it (I even put the priority to "high" ), I just haven''t booted into BeOS to get the files I''ll do it today
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Gack. The current BeOS network API... erm.... kind of sucks. They "haven''t yet" implemented just enough stuff as to make serious coding either annoying or impossible. LUCKILY a complete rewrite of the network layer is in the works -- they''re moving everything into the kernel (I beleive) and performance is supposed to be approaching that of Linux.

There are a lot of good socket primers on the web but here are a few that I think are particularly useful:
http://world.std.com/~jimf/papers/sockets/sockets.html
http://www.lowtek.com/sockets/
http://www.cs.utexas.edu/users/lavender/courses/socket++/ -- if you like C++ and don''t mind attempting a port
and the winsock faq, I think there should be some links to bsd stuff in there

Therre is likely some stuff at the Be site as well. Last time I checked (about a year ago) they had a few classes to make network programming a bit easier. The names all started with Net, if I recall. Also, BeOS has a sample FTP client that uses the classes.

Actually.... I wrote a sample multithreaded echo server for BeOS perhaps a year ago and I think I still have the code. It''s pretty basic but should at least cover accepting connections and sending/reading data. I''ll try to track it down.
Thanks to LordChaos, the problems are now fixed. It turned out I didn''t use htonl() and htons() at the right places in the code. Everything''s working fine right now.
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall

This topic is closed to new replies.

Advertisement