net: partial implementation of tcp
[quarnos.git] / resources / net / tcp_client_socket.h
blob874533af637c6574568e1c56f6bd1569e8d067ac
1 #ifndef _TCP_CLIENT_SOCKET_H_
2 #define _TCP_CLIENT_SOCKET_H_
4 #include "tcp.h"
5 #include "client_socket.h"
6 #include "libs/fifo.h"
8 namespace net {
9 class tcp_client_socket : public client_socket {
10 private:
11 int client_port;
13 int server_port;
14 ipv4_addr server;
16 fifo<buffer> incoming_data;
18 int sequence_number;
19 int ack_number;
21 bool negotiation;
23 void receive(const ipv4_addr &addr, u16 sender_port, const buffer &data, tcp::tcp_flags, int, int);
25 public:
26 tcp_client_socket(p<transport_layer> tl);
27 ~tcp_client_socket();
29 void connect(const ipv4_addr &addr, int port);
31 void write(const buffer &data);
32 void read(buffer &data);
34 void close();
38 #endif