Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5592 in orxonox.OLD for branches/network


Ignore:
Timestamp:
Nov 16, 2005, 2:12:30 PM (19 years ago)
Author:
rennerc
Message:

resolved conflict

Location:
branches/network/src/lib/network
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/network_socket.cc

    r5577 r5592  
    1010
    1111### File Specific:
    12    main-programmer: Christoph, David Hasenfratz
    13    co-programmer: 
     12   main-programmer: Christoph Renner, David Hasenfratz
     13   co-programmer:
    1414*/
    1515
     
    3333NetworkSocket::NetworkSocket()
    3434{
     35  /* set the class id for the base object */
     36  this->setClassID(CL_NETWORK_SOCKET, "NetworkSocket");
    3537
    36         /* Init SDL_net */
    37         if(SDLNet_Init()==-1)
    38         {
    39         PRINTF(1)("SDLNet_Init: %s\n", SDLNet_GetError());
     38  /* Init SDL_net */
     39  if(SDLNet_Init()==-1)
     40  {
     41    PRINTF(1)("SDLNet_Init: %s\n", SDLNet_GetError());
    4042    return;
    41         }
    42         else
    43                 PRINTF(5)("SDL_net initialized\n");
     43  }
     44  else
     45    PRINTF(5)("SDL_net initialized\n");
    4446
    4547}
     
    5153{
    5254
    53         /* Quit SDL_net */
    54         SDLNet_Quit();
    55         PRINTF(5)("SDL_net shutdown\n");
     55  /* Quit SDL_net */
     56  SDLNet_Quit();
     57  PRINTF(5)("SDL_net shutdown\n");
    5658}
    5759
     
    6365{
    6466
    65         /* Connect to the host and port contained in ip using a TCP connection. */
    66         tcpSocket = SDLNet_TCP_Open(&ip);
    67         if(!tcpSocket)
    68         {
     67  /* Connect to the host and port contained in ip using a TCP connection. */
     68  tcpSocket = SDLNet_TCP_Open(&ip);
     69  if(!tcpSocket)
     70  {
    6971    PRINTF(1)("SDLNet_TCP_Open: %s\n", SDLNet_GetError());
    7072    return;
    71         }
     73  }
    7274
    7375}
     
    8789{
    8890
    89         /* Close the connection */
    90         SDLNet_TCP_Close(tcpSocket);
     91  /* Close the connection */
     92  SDLNet_TCP_Close(tcpSocket);
    9193
    9294}
     
    9496/**
    9597  * This function writes some bytes (data) to the network connection (if the connection is already
    96   * estabilhed) otherwise it just does nothing (silently discarding the data). And writes some 
     98  * estabilhed) otherwise it just does nothing (silently discarding the data). And writes some
    9799  * warnings
    98100  */
  • branches/network/src/lib/network/network_socket.h

    r5588 r5592  
    1111#include "netdefs.h"
    1212
    13 /* include SDL_net header */
    14 #include "confincl.h"
    1513
     14/* include base_object.h since all classes are derived from this one */
     15#include "base_object.h"
    1616
    1717/* using namespace std is default, this needs to be here */
    1818using namespace std;
    1919
    20 class NetworkSocket
     20class NetworkSocket : public BaseObject
    2121{
    2222
    2323private:
    24         IPaddress serverAddress;
    25         unsigned int port;
    26         TCPsocket tcpSocket;
    27         UDPsocket udpSocket;
     24  IPaddress serverAddress;
     25  unsigned int port;
     26  TCPsocket tcpSocket;
     27  UDPsocket udpSocket;
    2828
    2929public:
Note: See TracChangeset for help on using the changeset viewer.