diff --git a/JChatClient/bin/client b/JChatClient/bin/client index 1d75fb1..3238bb1 100755 --- a/JChatClient/bin/client +++ b/JChatClient/bin/client diff --git a/JChatClient/src/Socket.cpp b/JChatClient/src/Socket.cpp index 440b407..11d4342 100644 --- a/JChatClient/src/Socket.cpp +++ b/JChatClient/src/Socket.cpp @@ -27,7 +27,7 @@ void Socket::Create() throw SocketException ( "TCP: Could not create socket" ); } setsockopt(sock,SOL_SOCKET,SO_KEEPALIVE,&optval,sizeof optval); - setsockopt(sock, SOL_TCP, TCP_NODELAY, &optval, sizeof optval); + setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &optval, sizeof optval); } void Socket::Bind(string address, int port) @@ -35,7 +35,7 @@ void Socket::Bind(string address, int port) sockAddr.sin_family = AF_INET; sockAddr.sin_port = htons(port); sockAddr.sin_addr.s_addr = inet_addr(address.c_str()); - if(bind(sock, (struct sockaddr *)&sockAddr, sizeof(struct sockaddr)) != 0) + if(::bind(sock, (struct sockaddr *)&sockAddr, sizeof(struct sockaddr)) != 0) { stringstream sstream; sstream << "TCP: Could not bind to address " << address << " on port " << port; @@ -186,4 +186,4 @@ const Socket& Socket::operator >> ( std::string& text ) message = NULL; } return *this; -} \ No newline at end of file +} diff --git a/JChatServer/bin/pad/prac2/Connection.class b/JChatServer/bin/pad/prac2/Connection.class index 53b85cd..5d729df 100644 --- a/JChatServer/bin/pad/prac2/Connection.class +++ b/JChatServer/bin/pad/prac2/Connection.class diff --git a/JChatServerV2/bin/pad/prac2/Connection.class b/JChatServerV2/bin/pad/prac2/Connection.class index 45202b6..1172914 100644 --- a/JChatServerV2/bin/pad/prac2/Connection.class +++ b/JChatServerV2/bin/pad/prac2/Connection.class diff --git a/JChatServerV2/bin/pad/prac2/MySocket.class b/JChatServerV2/bin/pad/prac2/MySocket.class index ea93697..4e245d9 100644 --- a/JChatServerV2/bin/pad/prac2/MySocket.class +++ b/JChatServerV2/bin/pad/prac2/MySocket.class diff --git a/JChatServerV2/src/pad/prac2/MySocket.java b/JChatServerV2/src/pad/prac2/MySocket.java index 26d367b..36f8d98 100644 --- a/JChatServerV2/src/pad/prac2/MySocket.java +++ b/JChatServerV2/src/pad/prac2/MySocket.java @@ -37,7 +37,7 @@ public class MySocket extends Socket try { output = super.getOutputStream(); - input = new BufferedReader(new InputStreamReader(super.getInputStream())); + input = new BufferedReader(new InputStreamReader(super.getInputStream(),"UTF-8")); } catch(IOException ioExc) {