aboutsummaryrefslogtreecommitdiff
path: root/src/socket.cpp (follow)
AgeCommit message (Collapse)Author
2009-07-29Wow, socket, as it turned out, was not able to close after the remote endMike Buland
disconnected. It now automatically closes down the local end when the remote end dies.
2009-05-28Added some helpers to the Bu::Cache::Ptr, you can clear them now, and cast toMike Buland
bool to see if they're bound, you still have to use isValid to see if they're valid or not. Also, fixed a bug in libbu++ that's been around for a while, apparently, in the Bu::Socket code. Non-blocking reading wasn't working correctly, when data wasn't waiting on the line, it would return immediately with zero bytes read. That was sure stupid. This should fix a lot of things.
2009-04-16Hey, the list code is better, also, I fixed some stuff in socket (theMike Buland
isBlocking function was backward), and fastcgi is actually working now! Also added comparison functions to FString.
2009-01-21david - needed to actually import the shutdown function from the winsock dll..David
2009-01-21david - #define SHUT_RDWR (SD_BOTH) if WIN32... blech... windows...David
2009-01-19Hey, the socket class closes the socket when the class is destroyed...why...whyMike Buland
wasn't that happening before?
2009-01-19Hey, more cases are covered for when the socket can close now.Mike Buland
2009-01-19This should fix the problem of never knowing if your sockets are closed. NowMike Buland
Bu::Socket::read will throw an exception if the socket has been closed. Also, you'll get an exception at object creation if the socket could connect to a computer, but not the given port.
2009-01-16I...think that's a little better. Wow, function pointers in windows have aMike Buland
lot of problems. This may require a little more research, but basically, you can't just call them inline wherever you'd like. I managed to get it to work by providing simple one line wrapper functions for each function we acquired as a pointer. Crazy mess. Anyway, it should load the library just once now, and Bu::Socket looks a little bit cleaner, but not a heck of a lot. I also added some more docs and removed the author references.
2009-01-15Fixed a minor suggestion in Bu::Socket, gcc wanted more parenthesies to make aMike Buland
statement clearer (good coding guide). Made the Taf code getters report their own errors, so much nicer. They actually tell you what was looked for from where and that it couldn't be found instead of a horrible old Bu::HashException key not found error.
2009-01-14david - oy, ok uses WSAGetLastError now on windows...David
2009-01-14david - removed debugging goo after finally getting it to workDavid
2009-01-14Gettin' closer.Mike Buland
2009-01-14Ok, no...now we have better debugging.Mike Buland
2009-01-14More debugging.Mike Buland
2009-01-14Ok...this may work. We completely changed the way Bu::Socket resolvesMike Buland
addresses. Windows wouldn't work with the other way at all. But, fortunately, this seems to work, it does more for us, and it looks pretty cute.
2009-01-13Fixed an out there corner case in Bu::Socket::read where it would get an EAGAINMike Buland
errno out of ::read for no apparent reason. Now it treats it as expected, it just returns zero bytes read.
2008-10-27david - apparently windows prefers to dynamically load winsock and a couple ↵David
other libraries, so I got it all compiling and working in windows, yay!... I tried to minimize the impact on the code: I made a DYNLOAD macro that evaluates to nothing on everything else, but runs the dynamic code if compiled for windows... also, apparently I had been randomly switching between ifdef and ifndef WIN32: so i made most of them ifdefs so it was less confusing...
2008-10-24david - ok, fixed the compiler warnings in socket class. got serversocket ↵David
compliling without warnings. added win32_compatibility.h along the same lines as osx_copatibility.h
2008-10-23david - first steps to getting socket to compile in windows (MinGW)... it ↵David
compiles, but there are a lot of warnings, and it hasn't been tested yet...
2008-10-01Ok, NIDS is getting better and better, and I went ahead and cleaned up someMike Buland
exception related code that's been annoying me. You should no longer have to include any exception header explicitly for normal operations, every class that has it's own exception to throw defines it in it's own headers. This may break some code that uses libbu++, but it's an easy fix, just delete the include for exceptions.h. Sometime soon I would also like to move from Bu::ExceptionBase to Bu::Exception, but that will affect a lot more code than this change did.
2008-09-24Ok, now all the warnings are gone (except for those coming from nids, but that'sMike Buland
ok, nids is still in flux, they'll be gone soon).
2008-02-07Just updated the copyright date.Mike Buland
2008-02-07Wowee, I think all this new stuff works, Conduit I don't need now, so it's notMike Buland
done yet. The Client class now supports a function called getLink() which returns a ClientLink object. This object may then be passed off to any other class and called to send messages to that client object. It is threadsafe if ItoServer is being used, and not for Server. Sending a message via a ClientLink calls the onMessage function on the assosiated protocol. Note that sending messages from within protocol event handlers or functions they call, while safe, may be slow and it's reccomended that you avoid this.
2007-11-15Added liscense info at the front of many, many files. Debating the old files.Mike Buland
2007-10-24Corrected a few issues that cropped up when using the Bu::Socket without aMike Buland
Client for buffering. The Bu::Client has also been made a little more reliable. The logger should get a few more tweaks, but it works fine for now, the hex dump could stand another tweak or two.
2007-10-08Fixed a bug in the Socket that would throw an exception if there was just tooMike Buland
much data in thou outgoing buffer on a write and you need to wait. Instead the write operation returns zero right now if that happens. It should be the only case that it returns zero in when there are bytes to be written and an exception is not triggered.
2007-09-07The Bu::Socket::getAddress function was always getting the local name of theMike Buland
socket, i.e. your address, not the client's address. That's not what I had intended, but it'd be nice to have later. This is corrected now.
2007-07-18Incorporated a patch contributed by Brandon CS Sanders that allows libbu++ toMike Buland
compile under OSX. So far, no problems with anything else, it looks like build and nango both build without problems, libbu++ is truly becoming a full cross- platform toolkit.
2007-07-15Bu::Socket now cashes a string representation of the IP address so you canMike Buland
access it even after closing a socket to assist with proper accounting.
2007-07-03Ah, that explains much, I did the big reorg -> trunk move and forgot to commitMike Buland
some things, so here they are, after being manually copied.
2007-07-02The list has an isEmpty funcion, and the socket may have a new read functionMike Buland
soon, check it out...later...
2007-06-28Client code is better, so is the socket, you can get addresses and other coolMike Buland
things from it. The plugger had yet another bugfix...plugger...
2007-06-18Added the protocol class. servers work, but don't send data, updated the streamsMike Buland
to include many more state indicators and caps queries, and everything is working better in general.
2007-06-10Bunch of maintenence type things. Minor tweaks and the like. The file classMike Buland
has a lot more helper functions and the like, the filters give more info back to the caller, minor updates to taf.
2007-05-17Lots of cool new stuff, the Server class actually works for everything exceptMike Buland
actually interacting with clients, and the Client class is almost there, except that it doesn't really do anything yet.
2007-04-26Merged Ito and put it in the BU namespace. I should probably clean up theMike Buland
formatting on the comments, some of the lines wrap, but I'm not too worried about it right now. I also fixed up the doxygen config and build.conf files so that everything is building nice and smooth now.
2007-04-20Fixed some goo in socket.Mike Buland
2007-04-10Added more comments, help, and socket actually reads and writes some, but it'sMike Buland
not done. I need to decide how I want to do the buffering...
2007-04-10I did it, the streams don't start with an S now.Mike Buland