Add a close method on socket. handle context termination in write();
Frame is now a class