Fixed some bugs in ProtocolSocketTest and in ProtocolSocket
Added some interfaces