-Socket sk_new(SockAddr addr, int port, int privport, sk_receiver_t receiver) {
+static Plug sk_tcp_plug (Socket sock, Plug p) {
+ Actual_Socket s = (Actual_Socket) sock;
+ Plug ret = s->plug;
+ if (p) s->plug = p;
+ return ret;
+}
+
+static void sk_tcp_flush (Socket s) {
+ /*
+ * We send data to the socket as soon as we can anyway,
+ * so we don't need to do anything here. :-)
+ */
+}
+
+void sk_tcp_close (Socket s);
+void sk_tcp_write (Socket s, char *data, int len);
+void sk_tcp_write_oob (Socket s, char *data, int len);
+char *sk_tcp_socket_error(Socket s);
+
+Socket sk_new(SockAddr addr, int port, int privport, int oobinline,
+ Plug plug)
+{
+ static struct socket_function_table fn_table = {
+ sk_tcp_plug,
+ sk_tcp_close,
+ sk_tcp_write,
+ sk_tcp_write_oob,
+ sk_tcp_flush,
+ sk_tcp_socket_error
+ };
+