socket formatting