Good afternoon,<br>I'm interested in using enet for a project.<br><br>I want to make a connection to a server.<br>So far I have code to create a host and make an outgoing connection:<br><br> client = enet_host_create(<br>
NULL /* create a client host */,<br> 1 /* only allow 1 outgoing connection */,<br> 57600 / 8 /* 56K modem with 56 Kbps downstream bandwidth */,<br> 14400 / 8 /* 56K modem with 14 Kbps upstream bandwidth */<br>
);<br> if (client == NULL)<br> throw new std::exception;<br><br> // try to connect to the patch server<br> enet_address_set_host( &address, "localhost" );<br> address.port = 3337;<br>
peer = enet_host_connect( client, &address, 1 );<br><br>Now I have a enet peer object. When I want to send to the server I do this:<br><br> ENetPacket* packet = enet_packet_create( msg, size, 0 );<br><br> /* Send the packet to the peer over channel id 0. */<br>
/* One could also broadcast the packet by */<br> /* enet_host_broadcast (host, 0, packet); */<br> enet_peer_send( peer, 0, packet );<br><br> /* One could just use enet_host_service() instead. */<br>
enet_host_flush( client );<br><br><br>I notice the host flush command looks at the peers member of the host structure but how does the peer I created using enet_host_connect() get into the peers array of the host struct?<br>
<br>Thanks!<br><br><br clear="all"><br>-- <br>Cause united breaks guitars<br><a href="http://www.youtube.com/watch?v=5YGc4zOqozo">http://www.youtube.com/watch?v=5YGc4zOqozo</a><br><br>