Are you trying to rescript DCC Chat? If you are, then you have to follow the protocol. If you're not, you can make up your own protocol.
You have /sockaccept tss but your sockread references ts, as does your on INPUT's /sockwrite.
You are also specifying the -d switch to bind to an IP; this switch is used if you have more than one IP connected to the internet so you most likely don't need it.
You use the -b switch for /sockwrite, indicating that you want to specify how many bytes you want to send, but you have not specified the number of bytes you wish to send after the socket name. This is used when you are sending binary data. The switch you want for sending straight text is -n to append a $crlf when the socket sends the data.
And finally, be aware that if you are writing your own protocol, both clients that are going to communicate must be using a script written to your new protocol. Just because you are using a protocol does not mean that anyone else is.