aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-tcp-stream.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-01-15 06:48:09 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-01-15 06:48:09 +0800
commit24a2d4baa8137fa990fff01b8e751538311d4de2 (patch)
tree9c6f87eac22ceed5b818425ef4598f0804373f54 /camel/camel-tcp-stream.c
parent80b2b2222ea67c50e0e3f9fdeb1797fb7874f862 (diff)
downloadgsoc2013-evolution-24a2d4baa8137fa990fff01b8e751538311d4de2.tar
gsoc2013-evolution-24a2d4baa8137fa990fff01b8e751538311d4de2.tar.gz
gsoc2013-evolution-24a2d4baa8137fa990fff01b8e751538311d4de2.tar.bz2
gsoc2013-evolution-24a2d4baa8137fa990fff01b8e751538311d4de2.tar.lz
gsoc2013-evolution-24a2d4baa8137fa990fff01b8e751538311d4de2.tar.xz
gsoc2013-evolution-24a2d4baa8137fa990fff01b8e751538311d4de2.tar.zst
gsoc2013-evolution-24a2d4baa8137fa990fff01b8e751538311d4de2.zip
Implemented. (stream_setsockopt): Implemented.
2001-01-14 Jeffrey Stedfast <fejj@ximian.com> * camel-tcp-stream-ssl.c (stream_getsockopt): Implemented. (stream_setsockopt): Implemented. * camel-tcp-stream-raw.c (stream_getsockopt): Implemented. (stream_setsockopt): Implemented. * camel-tcp-stream.c (camel_tcp_stream_getsockopt): New method. (camel_tcp_stream_setsockopt): Another new method. I think you get the idea of what these are for so I won't explain them. svn path=/trunk/; revision=7491
Diffstat (limited to 'camel/camel-tcp-stream.c')
-rw-r--r--camel/camel-tcp-stream.c58
1 files changed, 57 insertions, 1 deletions
diff --git a/camel/camel-tcp-stream.c b/camel/camel-tcp-stream.c
index e6ac31f450..d335cc7393 100644
--- a/camel/camel-tcp-stream.c
+++ b/camel/camel-tcp-stream.c
@@ -32,6 +32,8 @@ static CamelStreamClass *parent_class = NULL;
static int tcp_connect (CamelTcpStream *stream, struct hostent *host, int port);
static int tcp_disconnect (CamelTcpStream *stream);
+static int tcp_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
+static int tcp_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
static void
camel_tcp_stream_class_init (CamelTcpStreamClass *camel_tcp_stream_class)
@@ -44,6 +46,8 @@ camel_tcp_stream_class_init (CamelTcpStreamClass *camel_tcp_stream_class)
/* tcp stream methods */
camel_tcp_stream_class->connect = tcp_connect;
camel_tcp_stream_class->disconnect = tcp_disconnect;
+ camel_tcp_stream_class->getsockopt = tcp_getsockopt;
+ camel_tcp_stream_class->setsockopt = tcp_setsockopt;
}
static void
@@ -94,7 +98,7 @@ camel_tcp_stream_connect (CamelTcpStream *stream, struct hostent *host, int port
{
g_return_val_if_fail (CAMEL_IS_TCP_STREAM (stream), -1);
- return CTS_CLASS (stream)->connect (stream, offset, policy);
+ return CTS_CLASS (stream)->connect (stream, host, port);
}
@@ -121,3 +125,55 @@ camel_tcp_stream_disconnect (CamelTcpStream *stream)
return CTS_CLASS (stream)->disconnect (stream);
}
+
+
+static int
+tcp_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
+{
+ g_warning ("CamelTcpStream::getsockopt called on default implementation\n");
+ return -1;
+}
+
+
+/**
+ * camel_tcp_stream_getsockopt:
+ * @stream: tcp stream object
+ * @data: socket option data
+ *
+ * Get the socket options set on the stream and populate #data.
+ *
+ * Return value: zero on success or -1 on fail.
+ **/
+int
+camel_tcp_stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
+{
+ g_return_val_if_fail (CAMEL_IS_TCP_STREAM (stream), -1);
+
+ return CTS_CLASS (stream)->getsockopt (stream, data);
+}
+
+
+static int
+tcp_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
+{
+ g_warning ("CamelTcpStream::setsockopt called on default implementation\n");
+ return -1;
+}
+
+
+/**
+ * camel_tcp_stream_setsockopt:
+ * @stream: tcp stream object
+ * @data: socket option data
+ *
+ * Set the socket options contained in #data on the stream.
+ *
+ * Return value: zero on success or -1 on fail.
+ **/
+int
+camel_tcp_stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
+{
+ g_return_val_if_fail (CAMEL_IS_TCP_STREAM (stream), -1);
+
+ return CTS_CLASS (stream)->setsockopt (stream, data);
+}