-
September 28, 2008
-
September 17, 2008
Califoooorniaaaaaa
GeneralMichael and I are currently sitting at the Mobicom 2008 conference in San Francisco. We held our demonstration yesterday (which worked fine, costing me us — because I could not sleep over Felix’ swearing — only two full days and half a night to finish it), so now we’re finally starting to enjoy the trip.
I still can not quite grasp that I’m actually here — the city is incredibly diverse and we are having a lot of fun just strolling around and trying out different fast food restaurants.

From San Francisco 2008 Yesterday evening we also had time to do some “cultural” activity. Nano found the Hamlock Tavern which had a really cool program with three stand up comedians and two bands. I especially enjoyed Ali Wong and Chris Garcia — we laughed so hard even the beer started to taste good.
-
September 10, 2008
So easy you want to smash something
GeneralThis is freaking hysterical. Today I tried working on a simple UDP-multicast in java. Basically everything was already done and working: the process created serveral threads (server/client) of which two started sending/receiving multicast messaged via UDP. Everything worked just as expected.
The next step was to separate the two parts of the program, creating two processes with each one of the messaging threads in it. No big deal, right?
Here comes the ‘smashing’ part. The server worked just as expected, dutifully spewing multicast packets into the ether. But the client did not. In fact, the client simply hung itself right at the beginning of the following code:
try { socket = new MulticastSocket(port); group = InetAddress.getByName( addr ); socket.joinGroup( group ); } catch ( IOException ex ) { // ... }If you tried at least some basic networking in java the above will look awfully familiar: it’s the basic, fool-proof way you set up a socket to listen on. There is virtually nothing you can do wrong. Still, the program just hung at the socket creation, indicating the socket being idle. About thirty minutes and thirty trials later both programs still refused talking to each other like a lifelong married grumpy couple.
In my despair I tried this basic example for a UDP client — to my great surprise, the misused quote-client merrily disgorged the binary gibberish as the “latest quote” from the server (I would have laughed if I hadn’t had such a hard time keeping back the tears). There was virtually no difference between my class and the “quote client”!
Except my object being invoked by a thread. You might say now: “Felix, the basic behavior of an object should not depend on whether it was instantiated by the process itself or by one if its threads.”. And I would agree whole heartily. I would, in fact, tell anybody to shut up if he would try to suggest this as the source of the above problems. Still the facts are there: the socket only works if it is invoked directly or indirectly the main method of the process. It does not work if it is invoked by a thread.
Java networking. So easy. So goddam easy.

