Blog
Dump Server
Date: 13/4/2006
When you write client/server network software like an email client it's inevitable that some user, somewhere, is going to try and connect to a server that your app doesn't work with. And so it's normal to include logging in your app to capture the conversation between the client and server to a file. Scribe has an option to dump all the bytes to a log file in hex format, e.g.:
Read = 18
00000000	2B 4F 4B 20 48 65 6C 6C 6F 20 74 68 65 72 65 2E  +OK Hello there.
00000010	0D 0A                                            ..
Write = 11
00000000	55 53 45 52 20 74 65 73 74 0D 0A                 USER test..
Read = 24
00000000	2B 4F 4B 20 50 61 73 73 77 6F 72 64 20 72 65 71  +OK Password req
00000010	75 69 72 65 64 2E 0D 0A                          uired...
Write = 11
00000000	50 41 53 53 20 74 65 73 74 0D 0A                 PASS test..
Read = 16
00000000	2B 4F 4B 20 6C 6F 67 67 65 64 20 69 6E 2E 0D 0A  +OK logged in...
Write = 6
00000000	53 54 41 54 0D 0A                                STAT..
Read = 18
00000000	2B 4F 4B 20 39 33 32 20 32 35 30 34 39 31 31 39  +OK 932 25049119
00000010	0D 0A                                            ..
Write = 6
00000000	55 49 44 4C 0D 0A                                UIDL..
Read = 1024
00000000	2B 4F 4B 0D 0A 31 20 55 49 44 39 36 30 34 2D 31  +OK..1 UID9604-1
00000010	30 36 37 36 31 30 34 33 35 0D 0A 32 20 55 49 44  067610435..2 UID
00000020	39 36 30 36 2D 31 30 36 37 36 31 30 34 33 35 0D  9606-1067610435.
00000030	0A 33 20 55 49 44 39 36 31 30 2D 31 30 36 37 36  .3 UID9610-10676
00000040	31 30 34 33 35 0D 0A 34 20 55 49 44 39 36 31 31  10435..4 UID9611
...etc etc


Thats nice by itself but it really only lets you look at the data. What would be really nice is to actually be able to run your software locally under debug mode with something that made the same responses as the server in the field. So thats what "DumpServer" does, it reads in the log file and pretends to be the server in the log file, sending all the bytes under each read to the client. And it has a nice GUI as well:



Now I can fire up Scribe and get it to interact with the "server" just like the user does and hopefully find the point where things go off the rails in my own code.

How cool is that?
Comments:
SnappyCrunch
13/04/2006 9:14am
Pretty cool, Matthew, pretty cool.
 
Reply
From:
Email (optional): (Will be HTML encoded to evade harvesting)
Message:
 
Remember username and/or email in a cookie.
Notify me of new posts in this thread via email.
BBcode:
[q]text[/q]
[url=link]description[/url]
[img]url_to_image[/img]
[pre]some_code[/pre]
[b]bold_text[/b]