Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Nexy

Pages: [1]
1
Network / Problem with IP
« on: September 22, 2010, 03:00:10 pm »
Quote from: "Mindiell"
So, can you try the SFML network samples ? Is this working ?


No :(
It's working only with "127.0.0.1", not "83.145.154.170".

2
Network / Problem with IP
« on: September 21, 2010, 04:05:45 pm »
Quote from: "Mindiell"
Have you a firewall ?
Can you modify the ports the modem let available ?


No, I don't have firewall and I don't know why it doesn't work.

3
Network / Problem with IP
« on: September 20, 2010, 05:43:58 pm »
I used about 30 port and nothing. They are reserved or what? How I can check free ports in my router?

4
Network / Problem with IP
« on: September 20, 2010, 04:28:17 pm »
When I use
Code: [Select]
IPAddress ClientAddress/ServerAddress = "83.145.154.170"; it doesn't work! It works only with:
Code: [Select]
IPAddress ClientAddress/ServerAddress;

Why?

5
Network / Problem with IP
« on: September 20, 2010, 03:27:01 pm »
Thanks for reply. I'm using one computer with Motorola modem:



When I use
Quote
IPAddress ClientAddress;
program use "255.255.255.255", not "83.145.154.170". Why? Someone can help me?

6
Network / Problem with IP
« on: September 20, 2010, 09:27:25 am »
Hello,
I've problem with server and client connection.

Server:

Quote
#include <SFML/Network.hpp>
#include <iostream>


int main()
{
    const unsigned short Port = 2435;

    sf::SocketUDP Server;
    if (!Server.Bind(Port))
    {
        std::cout << " error" << std::endl;
    }

    sf::Packet Packet;
    sf::IPAddress ClientAddress;
    unsigned short ClientPort;
    Server.Receive(Packet, ClientAddress, ClientPort);

    int a;
    Packet >> a;
    std::cout << "packet : " << a << " from "<< ClientAddress <<" port: "<< ClientPort << std::endl;

    a=12345;
    Packet.Clear();
    Packet << a;
    Server.Send(Packet, ClientAddress, ClientPort);

    std::cin.ignore(10000, '\n');
    Server.Close();
    return EXIT_SUCCESS;
}


Client:

Quote
#include <SFML/Network.hpp>
#include <iostream>


int main()
{
    const unsigned short Port = 2400;

    sf::SocketUDP Client;
    if (!Client.Bind(Port))
    {
        std::cout << " error" << std::endl;
    }

    sf::Packet Packet;
    sf::IPAddress ServerAddress;
    unsigned short ServerPort=2435;

    int a;
    a=54321;
    Packet << a;
    Client.Send(Packet, ServerAddress, ServerPort);

    Packet.Clear();
    Client.Receive(Packet, ServerAddress, ServerPort);

    Packet >> a;
    std::cout << "packet : " << a << " from "<< ServerAddress <<" port: "<< ServerPort << std::endl;

    std::cin.ignore(10000, '\n');
    Client.Close();
    return EXIT_SUCCESS;
}


When I use "IPAddress ClientAddress;" it works. But when I use:

Quote
IPAddress::GetPublicAddress();
or
Quote
IPAddress Address("83.145.154.170");
it doesn't work!

This IP is from http://whatismyip.org

7
Network / [SOLVED] Server and client
« on: September 16, 2010, 07:23:45 pm »
@purkskis

It works! Thanks :)

//Topic to close

8
Network / [SOLVED] Server and client
« on: September 16, 2010, 05:59:09 pm »
Quote from: "Nexus"
The use of sockets and packets is explained in the tutorials.


I know. But I can't make "server <-> client" using UDP packets.

9
Network / [SOLVED] Server and client
« on: September 16, 2010, 05:47:13 pm »
Hello,
I'm having problem with using  packets. Can someone makes easy server and client using UDP?

Code: [Select]

// With UDP sockets

Socket.Send(Packet, Address, Port);
Socket.Receive(Packet, Address);


Example:

       
client sends "123" to server and server receives it,
server sends "456" to client and client receives it.

Pages: [1]